From 66739e5cf0e9a00ebe426b731793e33548be2525 Mon Sep 17 00:00:00 2001 From: jinzhongjia Date: Thu, 3 Oct 2024 19:58:43 +0800 Subject: [PATCH] fix: add pwsh support for zip decompression, zls wrong bin path (#4569) * fix: add pwsh support and lsp-zig wrong path * fix typos --- CHANGELOG.org | 1 + clients/lsp-zig.el | 2 +- lsp-mode.el | 13 ++++++++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.org b/CHANGELOG.org index d3a464bdd0..edaba88343 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -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. diff --git a/clients/lsp-zig.el b/clients/lsp-zig.el index ddf9d7b7bd..752143836a 100644 --- a/clients/lsp-zig.el +++ b/clients/lsp-zig.el @@ -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 diff --git a/lsp-mode.el b/lsp-mode.el index 2266d9b240..7a9928f4eb 100644 --- a/lsp-mode.el +++ b/lsp-mode.el @@ -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.") @@ -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