You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The project consists of a few OTP releases with applications, dependencies, and libraries in various folders. The configuration file is placed in the root folder for those releases, e.g.:
erlang_ls.config
erlector_rel/_erlector/lib/... (a few custom OTP applications)
erlector_rel/_erlector/lib/erlector/src/etr_api.erl (a specific file where erlang_ls can't find include)
erlector_rel/_erlector/lib/yolf/include/yolf.hrl (a specific file included in etr_api.erl above)
erlector_re/_erlector/deps/... (few rebar dependencies)
g@venus:~/work % ls -l erlector_rel/_erlector/lib/yolf/include/yolf.hrl
-rw-r--r-- 1 g g 2080 6 Jun 13:06 erlector_rel/_erlector/lib/yolf/include/yolf.hrl
To Reproduce
Add "include_lib" to an .erl file that includes the file from a relative folder using a path (see description above).
Expected behavior
The "include_lib" is correctly resolved and loaded by the compiler and not reported as "Can't find include lib".
Actual behavior
The "include_lib" isn't loaded and the source file shows an "erlang_ls" error that the file can't be included. The file compiles fine.
Context
erlang_ls version (tag/sha): 0.4.0+build.1161.ref64313bb
Editor used: IntelliJ
LSP client used: erlang_ls
The text was updated successfully, but these errors were encountered:
If an erlang file has a hrl included the compiler diagnostics raises an
error because it is not included in the operation.
Fix needs that the dependency directory is configured correctly.
Related erlang-ls#762
luos
added a commit
to luos/erlang_ls
that referenced
this issue
Jun 10, 2020
If an erlang file has a hrl included the compiler diagnostics raises an
error because it is not included in the operation.
Fix needs that the dependency directory is configured correctly.
Related erlang-ls#762
I think I have a same / similar problem, for me there is an include statement at the top of the file for a .hrl, but compile:file does not have the {i, Dir} as an argument, which makes this error come up.
This is an Erlang.mk project. I will open a PR with the fix, but I am not sure if it is the correct fix, because it needs that I add deps directory under deps_dirs in the erlang_ls.config file.
Describe the bug
The project consists of a few OTP releases with applications, dependencies, and libraries in various folders. The configuration file is placed in the root folder for those releases, e.g.:
erlang_ls.config
erlector_rel/_erlector/lib/... (a few custom OTP applications)
erlector_rel/_erlector/lib/erlector/src/etr_api.erl (a specific file where erlang_ls can't find include)
erlector_rel/_erlector/lib/yolf/include/yolf.hrl (a specific file included in etr_api.erl above)
erlector_re/_erlector/deps/... (few rebar dependencies)
The configuration file is as follows
The 'etr_api.erl' has the following include in line 44 which erlang_ls reports as not valid:
Diagnostic logs show the following request:
And the diagnostic error:
The interesting bit is that when hovering over the error the diagnostic dialog shows that the file is present:
can't find include lib "yolf/include/yolf.hrl"
/home/g/work/erlector_rel/_erlector/lib/yolf/include/yolf.hrl
Size: 2.08 kB
Type: Erlang Header (Erlang)
Modified: 06/06/20 13:06
Created: 06/06/20 13:06
To Reproduce
Add "include_lib" to an .erl file that includes the file from a relative folder using a path (see description above).
Expected behavior
The "include_lib" is correctly resolved and loaded by the compiler and not reported as "Can't find include lib".
Actual behavior
The "include_lib" isn't loaded and the source file shows an "erlang_ls" error that the file can't be included. The file compiles fine.
Context
erlang_ls
version (tag/sha): 0.4.0+build.1161.ref64313bbThe text was updated successfully, but these errors were encountered: