emacs-lsp / lsp-mode

Emacs client/library for the Language Server Protocol
https://emacs-lsp.github.io/lsp-mode
GNU General Public License v3.0
4.72k stars 861 forks source link

lsp-fsharp: failure when installing client #3022

Open Tarmil opened 2 years ago

Tarmil commented 2 years ago

Thank you for the bug report

Bug description

On a Windows system that has an unzip command in the PATH, the fsautocomplete client doesn't install properly.

Steps to reproduce

On Windows:

Expected behavior

fsautocomplete installs properly.

Which Language Server did you use?

lsp-fsharp

OS

Windows

Error callstack

Contacting host: api.github.com:443
Contacting host: github.com:443
Wrote c:/Users/LDENUZ~1/AppData/Local/Temp/fsautocompleterj0Xsa.zip
The syntax of the command is incorrect.
Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * You intended to execute a .NET program, but dotnet-c:/Users/ldenuziere/.emacs.d/.cache/lsp/fsautocomplete/fsautocomplete.dll does not exist.
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

Anything else?

The problem is that when unzip is present, the install function assumes that it's on a Unix system and runs a command intended for sh; but on Windows, it is misinterpreted by cmd. A possible fix would be to switch the conditions here to use powershell in priority if present: https://github.com/emacs-lsp/lsp-mode/blob/b4e51450188acf41f8273542db299936461087a4/clients/lsp-fsharp.el#L212-L214

razzmatazz commented 2 years ago

On linux, at least, there is also an issue that the server installed had no permissions on the files (probably due to faulty .zip archive or unzip params?) -- I need to do chmod +rwx -R * on the extracted directory

s-kostyaev commented 2 years ago

Fixed now

Horrih commented 3 weeks ago

Hello, Any news on this issue ? I encountered it just today, OP's solution seems reasonable to me.