Closed finzic closed 9 months ago
Hi! While a modern version of Erlang is required to build Erlang LS itself, you should still be able to use it in combination with older projects. Some features may not work as expected, but in that case the best thing would be to try and report.
Clone the repo, compile the server with rebar3 escriptize
(with a modern version of Erlang). Then (assuming you are using it via VS Code) go to the extension settings and change the erlang_ls.serverPath
setting to point to the executable you just built. For other editors, the procedure will be similar.
Perhaps my problem is that I work under Windows and the project in in WSL2 Ubuntu 18.04, so my VSCODE is running under windows.
I built erlang_ls under WSL with the command you suggested;
then I put it under ${HOME}/bin/erlang_ls
;
modified the extension settings and restarted the window, but still I get the same error, which is not very verbose:
Any suggestions?
Thanks in advance!
I managed to have VScode with erlang_ls plugin working smoothly under WSL2 with Ubuntu-22.04, which gave me enough hints about how to setup the system. Thank you; will report when I will be able to run VScode on my project.
@finzic The troubleshooting section of the website contains a few tips on troubleshooting Erlang LS. In your case, I am not sure it will help, though, since it seems like the entire server cannot start up. To me it sounds like an environment issue. I would attempt at starting the server manually in the same env where VS Code starts, via escript
:
escript /path/to/erlang_ls -h # Show help
escript /path/to/erlang_ls # Start in server mode
One way to ensure Erlang, escript
and erlang_ls
are in the path is to add a mock launch configuration which starts the server, just to verify whether you get a better error.
Also, you could check selecting something else than "Erlang LS" in the output tab (most likely VS Code - UI
or VS Code - Workspace
) to check whether there's a more specific error message.
@finzic The troubleshooting section of the website contains a few tips on troubleshooting Erlang LS. In your case, I am not sure it will help, though, since it seems like the entire server cannot start up. To me it sounds like an environment issue. I would attempt at starting the server manually in the same env where VS Code starts, via
escript
:escript /path/to/erlang_ls -h # Show help escript /path/to/erlang_ls # Start in server mode
Thank you, my solution was to
erlang_ls
escript would run correctly; otp_path: "/home/finzic/.evm/erlang_versions/otp_src_17.3/lib/erlang"
in erlang_ls.config
within the project directory.
With these 3 main steps, I managed to get it to start and parse; I can go to function definition and it looks very helpful; it also suggests completions using only erlang 17.3 OTP library functions, which is great.
Since we use the old Chicago Boss library, which adds some syntactical stuff which extends Erlang syntax, of course those usages are all reported as errors, and it' OK.
Thank you!
I am working on a project that uses Erlang 17.3. Is there any plan to extend compatibility to older Erlang versions, or is it not possible because of missing language features? Thank you