erlang_ls
erlang_ls copied to clipboard
Cowboy behaviour undefined
Erlang LS gives me a warning that behaviour cowboy_rest is undefined. Even if I include "_build/default/lib" in include_dirs in erlang_ls.config.
If I also include "_build/default/lib/cowboy/src" in include_dirs in erlang_ls.config I get the warning: Issue in included file (18): behaviour cowboy_sub_protocol undefined
I made this small repo to reproduce the issue: Repo
Expected behavior I expected the cowboy_rest behaviour to be found by default.
Actual behavior The cowboy_rest behaviour is not found
Context
-
erlang_ls
version (tag/sha): 0.17.0 - Editor used: VS Code 1.57.1
- LSP client used: erlang-ls.erlang-ls v0.0.27
It's actually complaining about the cowboy_sub_protocol
not being found in cowboy_rest
.
This is similar to this issue:
https://github.com/erlang-ls/erlang_ls/issues/1024
I worked around this for now by adding:
code_path_extra_dirs:
- "./_build/default/lib/*/ebin/"
to my erlang_ls.config
.
Thank you @dweinstein. That works for me also :)
hi @plux was this issue fixed by some code change or is the workaround still best to use? I noticed you marked this ticket as completed so I was just curious if I should try updating my erlang_ls.config
. Thanks for the work you're doing!
I think this issue still exists and we should investigate it further. I will open it again.
Unfortunately that workaround doesn't work for me with the behavior cowboy_middleware
.
I think I have found the issue for this. I will submit a PR later.