From 532d38b3472c8b229c7c50f30f0dda1121768ca5 Mon Sep 17 00:00:00 2001 From: Charles Gonnaud <36566033+Horrih@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:03:52 +0200 Subject: [PATCH] Fix tool detection order for lsp-unzip on windows (#3022) (#4472) It caused issues on windows if unzip was found on the PATH Co-authored-by: Jen-Chieh Shen --- CHANGELOG.org | 1 + lsp-mode.el | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.org b/CHANGELOG.org index cac2cabeb2..d3a464bdd0 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -18,6 +18,7 @@ unified ~(lsp-interface INTERFACE ...)~ form. The per-interface forms are no 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 ** 9.0.0 * Add language server config for QML (Qt Modeling Language) using qmlls. diff --git a/lsp-mode.el b/lsp-mode.el index 581739438a..2266d9b240 100644 --- a/lsp-mode.el +++ b/lsp-mode.el @@ -8458,7 +8458,10 @@ archive (e.g. when the archive has multiple files)" "Unzip script to unzip file.") (defcustom lsp-unzip-script (lambda () - (cond ((executable-find "unzip") lsp-ext-unzip-script) + (cond ((and (eq system-type 'windows-nt) + (executable-find "powershell")) + lsp-ext-pwsh-script) + ((executable-find "unzip") lsp-ext-unzip-script) ((executable-find "powershell") lsp-ext-pwsh-script) (t nil))) "The script to unzip."