- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 939
 
Open
Labels
Description
Thank you for the bug report
-  I am using the latest version of 
lsp-moderelated packages. - I checked FAQ and Troubleshooting sections
 - You may also try reproduce the issue using clean environment using the following command
 
emacs -q -l lsp-start-plain.elwhere lsp-start-plain.el can be downloaded here.
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:
- Put 
unzip.exesomewhere in thePATH. - Try to install lsp-fsharp.
 
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: 
lsp-mode/clients/lsp-fsharp.el
Lines 212 to 214 in b4e5145
| (unzip-script (cond ((executable-find "unzip") (format "mkdir -p %s && unzip -qq %s -d %s" install-dir-full temp-file install-dir-full)) | |
| ((executable-find "powershell") (format "powershell -noprofile -noninteractive -nologo -ex bypass Expand-Archive -path '%s' -dest '%s'" temp-file install-dir-full)) | |
| (t (user-error (format "Unable to unzip server - file %s cannot be extracted, please extract it manually" temp-file))))) |