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 860 forks source link

Error: install pwsh-ls on Windows #3762

Open seagle0128 opened 1 year ago

seagle0128 commented 1 year ago

Thank you for the bug report

Bug description

When I installed pwsh-ls via M-x lsp-install-server on Windows, I got the error. It seems the path including spaces is not able to be handled correctly. I paste the details below.

Steps to reproduce

M-x lsp-install-server and select pwsh-ls on Windows, and the file path has spaces.

Expected behavior

Install pwsh-ls without any error

Which Language Server did you use?

pwsh-ls

OS

Windows

Error callstack

"c:/Program Files/PowerShell/7/pwsh.exe" "-noprofile" "-noninteractive" "-nologo" "-ex" "bypass" "-command" "Invoke-WebRequest" "-UseBasicParsing" "-uri" "https://github.com/PowerShell/PowerShellEditorServices/releases/latest/download/PowerShellEditorServices.zip" "-outfile" "c:/Users/VINCEN~1/AppData/Local/Temp/extpfbOae.zip" ";" "Expand-Archive" "-Path" "c:/Users/VINCEN~1/AppData/Local/Temp/extpfbOae.zip" "-DestinationPath" "c:/Users/Vincent Zhang/AppData/Roaming/.emacs.d/.cache/lsp/pwsh"

Expand-Archive: A positional parameter cannot be found that accepts argument 'Zhang/AppData/Roaming/.emacs.d/.cache/lsp/pwsh'.

Anything else?

This command works well.

pwsh "-noprofile" "-noninteractive" "-nologo" "-ex" "bypass" "-command" "Invoke-WebRequest" "-UseBasicParsing" "-uri" "https://github.com/PowerShell/PowerShellEditorServices/releases/latest/download/PowerShellEditorServices.zip" "-outfile" "c:/Users/VINCEN~1/AppData/Local/Temp/extpfbOae.zip" ";" "Expand-Archive" "-Path" "c:/Users/VINCEN~1/AppData/Local/Temp/extpfbOae.zip" "-DestinationPath" "c:/Users/VINCEN~1/AppData/Roaming/.emacs.d/.cache/lsp/pwsh"
yyoncho commented 1 year ago

cc @kiennq