Closed aaronlelevier closed 4 years ago
I found this issue in Sublime Text LSP issues: https://github.com/sublimelsp/LSP/issues/1137
Maybe it's related. I am going to read it and check.
Ok, let us know if you realize they are two occurrences of the same issue.
I am not sure to be honest. When I run the last command in the linked LSP issue, it seems to work. I get this:
aaron@ ~/Documents/github/erlang_ls ((HEAD detached at 0.4.1))
$ erlang_ls --version
Version: 0.4.1
The issue is due to my local environment.
When I ran shutil.which("erlang_ls")
before, I would get no output, and Erlang-LS had didn't start because of the path issue.
But now on another machine I get the following, and Erlang-LS is working as expected.
>>> import shutil
>>> shutil.which("erlang_ls")
'/usr/local/bin/erlang_ls'
It was due to a path issue with SublimeText. This package fixed it for me on my original machine: https://github.com/int3h/SublimeFixMacPath
Glad to hear that you found a solution. I'm going to add the above as hints for the Sublime section in erlang-ls.github.io.
@aaronlelevier Also, looking at your config file, you were using an absolute path:
"/Users/aaron/Documents/github/erlang_ls/_build/default/bin/erlang_ls"
Maybe it was Erlang itself not to be in the path? I'm not a Sublime Text user. Is there a terminal I can open from Sublime to verify the "path" from Sublime perspective?
Updated docs: https://github.com/erlang-ls/erlang-ls.github.io/pull/24
Thank you for submitting https://github.com/erlang-ls/erlang-ls.github.io/pull/24. That will help other Sublime Text users I think.
About my absolute path above, yes that is correct. The path was not on the Erlang code path, so it didn't work.
Okay, I see in https://github.com/erlang-ls/erlang-ls.github.io/pull/24 your notes on toggling the Show Console. From the Menu Bar its under View > Show Console
With the open Sublime Text console, which is a Python terminal, I then ran commands like this to inspect the path:
import shutil
shutil.which("erlang_ls")
import os
os.environ["PATH"]
Maybe one other thing to include that helped me is the Sublime Text auto-save
package. I didn't know if Erlang-LS was working until I saw that it's triggered on save, which Sublime Text only has an option to do this on file close or file blur, so the auto-save
package does this every 1 second, so you get the Erlang-LS feedback a lot easier. Here's the link:
Describe the bug I am getting an exit code of 127 when trying to run Erlang-LS with LSP.
I tried following the configuration advise in #565 as I thought that it might be the same issue, but I couldn't get around the error.
I'm not sure if this is related to Erlang-LS or Sublime Text LSP, but I thought that I could start asking here.
I googled the error and it says here that the error is:
I checked my
erlang_ls
executable, and it looks fine:To Reproduce Here are the logs from Sublime Text:
erlang_ls.config
LSP.sublime-settings
Expected behavior To be able to use Erlang-LS with Sublime Text 3 LSP.
Actual behavior Can't use Erlang-LS with Sublime Text 3 LSP.
Context
This is for an open source hobby project of mine. I'm trying to Erlang better. I created a branch for this here if that helps.