diff --git a/pkgs/misc/vscode-extensions/terraform/default.nix b/pkgs/misc/vscode-extensions/terraform/default.nix index 658495296bf6..dbc4873c85b9 100644 --- a/pkgs/misc/vscode-extensions/terraform/default.nix +++ b/pkgs/misc/vscode-extensions/terraform/default.nix @@ -3,19 +3,19 @@ vscode-utils.buildVscodeMarketplaceExtension rec { mktplcRef = { name = "terraform"; publisher = "hashicorp"; - version = "2.13.0"; + version = "2.13.1"; }; vsix = fetchurl { name = "${mktplcRef.publisher}-${mktplcRef.name}.zip"; url = "https://github.com/hashicorp/vscode-terraform/releases/download/v${mktplcRef.version}/${mktplcRef.name}-${mktplcRef.version}.vsix"; - sha256 = "1wc4jl4h3ja4ivynf20yxzwqssi6yd7alvqvcjrkksic98480qcz"; + sha256 = "1l7gsb28yj2z1zfzgb8xiyf166v4blxfdkyiixlm1pqnn2lj6yb6"; }; patches = [ ./fix-terraform-ls.patch ]; postPatch = '' - substituteInPlace out/extension.js --replace TERRAFORM-LS-PATH ${terraform-ls}/bin/terraform-ls + substituteInPlace out/clientHandler.js --replace TERRAFORM-LS-PATH ${terraform-ls}/bin/terraform-ls ''; meta = with lib; { diff --git a/pkgs/misc/vscode-extensions/terraform/fix-terraform-ls.patch b/pkgs/misc/vscode-extensions/terraform/fix-terraform-ls.patch index 95e8d92da332..02991c0826f6 100644 --- a/pkgs/misc/vscode-extensions/terraform/fix-terraform-ls.patch +++ b/pkgs/misc/vscode-extensions/terraform/fix-terraform-ls.patch @@ -1,8 +1,22 @@ +diff --git a/out/clientHandler.js b/out/clientHandler.js +index 6d314ea..dadab90 100644 +--- a/out/clientHandler.js ++++ b/out/clientHandler.js +@@ -33,8 +33,7 @@ class ClientHandler { + this.reporter.sendTelemetryEvent('usePathToBinary'); + } + else { +- const installPath = path.join(context.extensionPath, 'lsp'); +- this.pathToBinary = path.join(installPath, 'terraform-ls'); ++ this.pathToBinary = 'TERRAFORM-LS-PATH'; + } + } + startClients(folders) { diff --git a/out/extension.js b/out/extension.js -index e932d27..099126b 100644 +index f1eb66d..9b0f832 100644 --- a/out/extension.js +++ b/out/extension.js -@@ -143,25 +143,6 @@ function updateLanguageServer() { +@@ -145,25 +145,6 @@ function updateLanguageServer(clientHandler, installPath) { return __awaiter(this, void 0, void 0, function* () { const delay = 1000 * 60 * 60 * 24; languageServerUpdater.timeout(updateLanguageServer, delay); // check for new updates every 24hrs @@ -11,7 +25,7 @@ index e932d27..099126b 100644 - const installer = new languageServerInstaller_1.LanguageServerInstaller(installPath, reporter); - const install = yield installer.needsInstall(); - if (install) { -- yield stopClients(); +- yield clientHandler.stopClients(); - try { - yield installer.install(); - } @@ -25,15 +39,6 @@ index e932d27..099126b 100644 - } - } - } - return startClients(); // on repeat runs with no install, this will be a no-op + return clientHandler.startClients(vscodeUtils_1.prunedFolderNames()); // on repeat runs with no install, this will be a no-op }); } -@@ -259,7 +240,7 @@ function pathToBinary() { - reporter.sendTelemetryEvent('usePathToBinary'); - } - else { -- command = path.join(installPath, 'terraform-ls'); -+ command = 'TERRAFORM-LS-PATH'; - } - _pathToBinaryPromise = Promise.resolve(command); - }