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
I am developting an extension that uses the LanguageClient class to provide a connection to a language server. The language server is installed globally on the OS and can be started using a <command> as it is in $PATH (installed via npm -g i <package>).
Now, the client fails to start the server. My first approach was using these server options:
But child_process#spawn's options does (ref to docs).
As this behaviour is rather unintuitive to me, I think this might be a bug or or there is some documentation missing on this. I just want to start <command> --stdio to use it as a language server. According to this issue it should suffice to provide options: { cwd: undefined, env: process.env }. But it does not seem to work. It works with options: { shell: true } only, but shell is not included in ExecutableOptions.
OS: Windows 10
Dependencies:
"vscode": "^1.1.18",
"vscode-languageclient": "^4.2.1"
The text was updated successfully, but these errors were encountered:
Yes, I see the point. The thing is that npm -g i very likely installs a shell script and that script can't be run using spwan without using the shell option.
I am developting an extension that uses the
LanguageClient
class to provide a connection to a language server. The language server is installed globally on the OS and can be started using a<command>
as it is in$PATH
(installed vianpm -g i <package>
).Now, the client fails to start the server. My first approach was using these server options:
This does not work, as
child_process#spawn
does not get the environment variables. This is the relevant section in the code:https://github.com/Microsoft/vscode-languageserver-node/blob/583ba3878faa9e550461337afefb1618505a4601/client/src/main.ts#L397-L405
My second attempt was to pass
process.env
asenv
option:This also did not work. I also tried to pass
cwd: undefined
viaoptions
.One thing that worked for me was to use
shell: true
inoptions
. However, both declarations ofExecutableOptions
do not include ashell?: boolean
:https://github.com/Microsoft/vscode-languageserver-node/blob/583ba3878faa9e550461337afefb1618505a4601/client/src/main.ts#L37-L42
https://github.com/Microsoft/vscode-languageserver-node/blob/c7d5ab633672f5b38886ee54f5dd10c3a8d3646d/client/src/client.ts#L190-L195
But
child_process#spawn
'soptions
does (ref to docs).As this behaviour is rather unintuitive to me, I think this might be a bug or or there is some documentation missing on this. I just want to start
<command> --stdio
to use it as a language server. According to this issue it should suffice to provideoptions: { cwd: undefined, env: process.env }
. But it does not seem to work. It works withoptions: { shell: true }
only, butshell
is not included inExecutableOptions
."vscode": "^1.1.18",
"vscode-languageclient": "^4.2.1"
The text was updated successfully, but these errors were encountered: