VS Code doesn't process Erlang Makefile

Viewed 44

I'm working on an old erlang code that uses Makefiles to compile. The makefile defines some "include" paths:

# Erlang include directories. 
HRL_INCLUDE_DIRS = \
    ../include

My module imports modules from that path and uses it:

-include("logger.hrl").

VS Code doesn't seem to find this file (red squiggly line under the include statement and function calls.), because logger should have relative or absolute path.

The Makefile does the magic behind the scenes but VS Code doesn't read it.

How to configure VS Code to read the makefile?

1 Answers

The question is where the red squiggly line is coming from. Are you using the erlang-ls extension? If so, you probably need to configure include_dirs in an erlang_ls.config file in the root of your project.

include_dirs:
  - "path/to/include"
Related