elixir-lsp / vscode-elixir-ls

Elixir language support and debugger for VS Code, powered by ElixirLS.
https://marketplace.visualstudio.com/items?itemName=JakeBecker.elixir-ls
MIT License
535 stars 106 forks source link

the extension not accessing the path to batch file correctly #432

Closed Aulk98 closed 1 month ago

Aulk98 commented 1 month ago

@lukaszsamson @wheredoipressnow Hi there is still some issue in LS even after update but it is coming from both vs_code versions 1.91.1 & 1.92.0 here is Error ElixirLS output:

D:\Elixir' is not recognized as an internal or external command,
 operable program or batch file.
 [Error - 10:53:03 AM] Server initialization failed.
   Message: Pending response rejected since connection got disposed
   Code: -32097 
 [Info  - 10:53:03 AM] Connection to server got closed. Server will restart.
 true
 [Error - 10:53:03 AM] ElixirLS - Elixir_Project client: couldn't create connection to server.
   Message: Pending response rejected since connection got disposed
   Code: -32097 
 [Error - 10:53:03 AM] Server process exited with code 1.
 'D:\Elixir' is not recognized as an internal or external command,
 operable program or batch file.
 [Error - 10:53:03 AM] Server initialization failed.
   Message: Pending response rejected since connection got disposed
   Code: -32097 
 [Info  - 10:53:03 AM] Connection to server got closed. Server will restart.
 true
 [Error - 10:53:03 AM] ElixirLS - Elixir_Project client: couldn't create connection to server.
   Message: Pending response rejected since connection got disposed
   Code: -32097 
 [Error - 10:53:03 AM] Server process exited with code 1.
 'D:\Elixir' is not recognized as an internal or external command,
 operable program or batch file.
 [Error - 10:53:03 AM] Server initialization failed.
   Message: Pending response rejected since connection got disposed
   Code: -32097 
 [Info  - 10:53:03 AM] Connection to server got closed. Server will restart.
 true
 [Error - 10:53:03 AM] ElixirLS - Elixir_Project client: couldn't create connection to server.
   Message: Pending response rejected since connection got disposed
   Code: -32097 
 [Error - 10:53:03 AM] Restarting server failed
   Message: Pending response rejected since connection got disposed
   Code: -32097 
 [Error - 10:53:03 AM] Server process exited with code 1.
 'D:\Elixir' is not recognized as an internal or external command,
 operable program or batch file.
 [Error - 10:53:03 AM] Server initialization failed.
   Message: Pending response rejected since connection got disposed
   Code: -32097 
 [Info  - 10:53:03 AM] Connection to server got closed. Server will restart.
 true
 [Error - 10:53:03 AM] ElixirLS - Elixir_Project client: couldn't create connection to server.
   Message: Pending response rejected since connection got disposed
   Code: -32097 
 [Error - 10:53:03 AM] Restarting server failed
   Message: Pending response rejected since connection got disposed
   Code: -32097 
 [Error - 10:53:03 AM] Server process exited with code 1.
 'D:\Elixir' is not recognized as an internal or external command,
 operable program or batch file.
 [Error - 10:53:03 AM] Server initialization failed.
   Message: Pending response rejected since connection got disposed
   Code: -32097 
 [Error - 10:53:03 AM] The ElixirLS - Elixir_Project server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
 [Error - 10:53:03 AM] ElixirLS - Elixir_Project client: couldn't create connection to server.
   Message: Pending response rejected since connection got disposed
   Code: -32097 
 [Error - 10:53:03 AM] Restarting server failed
   Message: Pending response rejected since connection got disposed
   Code: -32097 
 [Error - 10:53:03 AM] Server process exited with code 1.

so, can you please fix this issue or way to fix this issue

Edit: I don't know if I am correct or wrong, I think the extension not accessing the path to batch file correctly, in laguageserver override path if I give "path/to/release" it works, but without quotes i get same error

lukaszsamson commented 1 month ago

I cannot reproduce that. What is your configuration? How did you install the extension?

Aulk98 commented 1 month ago

@lukaszsamson

Elixir 1.17.2 (compiled with Erlang/OTP 27)

lukaszsamson commented 1 month ago

Sorry, it's confusing. Are you trying to use the extension or contribute to it? If you aim to contribute then head to https://github.com/elixir-lsp/vscode-elixir-ls?tab=readme-ov-file#contributing Otherwise, it seems elixir command is not accessible in your system PATH.

Aulk98 commented 1 month ago

image just for clarification, normally how should we insert path in this setting edit: with or without quates ?

lukaszsamson commented 1 month ago

Normally you don't need to pass anything there

Aulk98 commented 1 month ago

yeah, I know but the extension didn't access the .bat file D:\Elixir' is not recognized as an internal or external command, operable program or batch file. by default, it should access the file from C:\Users\%userprofile%.vscode\extensions\jakebecker.elixir-ls-0.23.0\elixir-ls-release and start the LS but in my case it directly sending path to shell which is causing the error so, I tried to set path without quates I got the same error image then I tried with quates and it works then the debug session not starting image image

paulanthonywilson commented 1 month ago

Do you have spaces in your path / user home directory?

A number of people at work who are using Windows and have spaces in their windows home directory path (or whatever it's called in windows) are reporting similar issues having just updated.

Aulk98 commented 1 month ago

@lukaszsamson I just created PR for this issue, now it is working perfectly fine

Aulk98 commented 1 month ago

Do you have spaces in your path / user home directory?

A number of people at work who are using Windows and have spaces in their windows home directory path (or whatever it's called in windows) are reporting similar issues having just updated.

@paulanthonywilson you mean userprofile, yeah I have spaces in it

iamkanishka commented 1 month ago

@lukaszsamson I hope a solution from @Aulk98 resolves the issues once PR is merged. PLease Let me know once the new version is released, Thanks in advance

lukaszsamson commented 1 month ago

https://github.com/elixir-lsp/vscode-elixir-ls/pull/433 is supposedly fixing that but I need to verify it does not break mac and linux. I'll try to release a patch shortly.