Skip to content

Commit

Permalink
fix: add pwsh support for zip decompression, zls wrong bin path (#4569)
Browse files Browse the repository at this point in the history
* fix: add pwsh support and lsp-zig wrong path

* fix typos
  • Loading branch information
jinzhongjia authored Oct 3, 2024
1 parent 52de586 commit 66739e5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.org
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
longer generated. *This is a breaking change.* (See #4430.)
* If asm-lsp is installed, lsp-asm won't try to download it to cache store
* Fix lsp-unzip on windows when unzip was found on the PATH
* Fix zls wrong bin path

** 9.0.0
* Add language server config for QML (Qt Modeling Language) using qmlls.
Expand Down
2 changes: 1 addition & 1 deletion clients/lsp-zig.el
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ If `true', replace the text after the cursor."
This is differ from the variable `lsp-zig-zls-executable'; this is local storage
and not the global storage."
(f-join lsp-zig-server-store-path
(pcase system-type ('windows-nt "bin/zls.exe") (_ "bin/zls"))))
(pcase system-type ('windows-nt "zls.exe") (_ "zls"))))

(lsp-dependency
'zls
Expand Down
13 changes: 10 additions & 3 deletions lsp-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -8450,7 +8450,11 @@ archive (e.g. when the archive has multiple files)"

;; unzip

(defconst lsp-ext-pwsh-script "powershell -noprofile -noninteractive \
(defconst lsp-ext-pwsh-script "pwsh -noprofile -noninteractive \
-nologo -ex bypass -c Expand-Archive -Path '%s' -DestinationPath '%s'"
"Pwsh script to unzip file.")

(defconst lsp-ext-powershell-script "powershell -noprofile -noninteractive \
-nologo -ex bypass -command Expand-Archive -path '%s' -dest '%s'"
"Powershell script to unzip file.")

Expand All @@ -8459,10 +8463,13 @@ archive (e.g. when the archive has multiple files)"

(defcustom lsp-unzip-script (lambda ()
(cond ((and (eq system-type 'windows-nt)
(executable-find "powershell"))
(executable-find "pwsh"))
lsp-ext-pwsh-script)
((and (eq system-type 'windows-nt)
(executable-find "powershell"))
lsp-ext-powershell-script)
((executable-find "unzip") lsp-ext-unzip-script)
((executable-find "powershell") lsp-ext-pwsh-script)
((executable-find "pwsh") lsp-ext-pwsh-script)
(t nil)))
"The script to unzip."
:group 'lsp-mode
Expand Down

0 comments on commit 66739e5

Please sign in to comment.