-
Notifications
You must be signed in to change notification settings - Fork 48
LSP Error: Can't start server, plese check settings #147
Comments
As a temporary debugging measure, try putting the following into a script (or the Windows equivalent if that is your world):
And then set that script as the raw command for your desired extension type. I suspect you will find that the environment that your language server is being run in lacks needed environment variables to run node. I ran into the same thing trying to run a Python based language server that was only installed in a virtual environment. For me, the solution seems be to make a custom script that sets the needed environment variables and acts as a pass through for stdio. |
I also had the same problem and was able to solve it.
When I tried to set this executable in the lsp configuration, I got the same error message that "node could not be found". Long story short: I ended up with the following working raw command:
Also a restart of the IDE might help after setting a new configuration. I hope this helps others by using any node based lsp |
@bghill What does the script look like? Namely, how do you ensure I/O is passed through correctly? |
@holyjak: I don't know if this will work for others, but I really just added a minor tweak to one of the virtual env shim scripts. I didn't include it because I am using both pyenv and virtual-envs which is pretty specific. #!/bin/sh
export PATH="/usr/local/bin:${PATH}"
# Why don't these set the env vars within this script?
# eval "$(pyenv init -)"
export PATH="/home/userid/.pyenv/shims:${PATH}"
export PYENV_SHELL=sh
command pyenv rehash 2>/dev/null
pyenv() {
local command
command="${1:-}"
if [ "$#" -gt 0 ]; then
shift
fi
case "$command" in
activate|deactivate|rehash|shell)
eval "$(pyenv "sh-$command" "$@")";;
*)
command pyenv "$command" "$@";;
esac
}
# eval "$(pyenv virtualenv-init -)"
export PATH="/usr/local/Cellar/pyenv-virtualenv/1.1.5/shims:${PATH}";
export PYENV_VIRTUALENV_INIT=1;
_pyenv_virtualenv_hook() {
local ret=$?
if [ -n "$VIRTUAL_ENV" ]; then
eval "$(pyenv sh-activate --quiet || pyenv sh-deactivate --quiet || true)" || true
else
eval "$(pyenv sh-activate --quiet || true)" || true
fi
return $ret
};
if ! [[ "$PROMPT_COMMAND" =~ _pyenv_virtualenv_hook ]]; then
export PROMPT_COMMAND="_pyenv_virtualenv_hook;$PROMPT_COMMAND";
fi
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
pyenv activate some-lsp-venv; some-lsp --check-parent-process |
Hello!
With PHPStorm 2020.1 i get the following error while opening a project or opening composer.json:
Kind Regards,
Chris
The text was updated successfully, but these errors were encountered: