From 283b0d1b21405d1652236cf8b947dcf6fc1b3344 Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Tue, 4 May 2021 15:25:13 +0800 Subject: [PATCH] (GH-618) Add checkForUpdates setting This commit adds a "terraform.checkForUpdates" setting which stops the extension checking if any Language Server updates are available. Note that according to the VSCode guidelines, there should be a "Do not show again" button in the notification as well. Future commits may add this. --- package.json | 6 ++++++ src/extension.ts | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 842e7171b2..0dd79d560d 100644 --- a/package.json +++ b/package.json @@ -164,6 +164,12 @@ "default": false } } + }, + "terraform.checkForUpdates": { + "type": "boolean", + "default": true, + + "description": "Automatically check for Terraform Language Server Updates." } } }, diff --git a/src/extension.ts b/src/extension.ts index f20365a67e..72237a2405 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -175,8 +175,8 @@ async function updateLanguageServer() { const delay = 1000 * 60 * 60 * 24; languageServerUpdater.timeout(updateLanguageServer, delay); // check for new updates every 24hrs - // skip install if a language server binary path is set - if (!config('terraform').get('languageServer.pathToBinary')) { + // skip install if a language server binary path is set, or update checks are disabled + if (!config('terraform').get('languageServer.pathToBinary') && config('terraform').get('checkForUpdates')) { const installer = new LanguageServerInstaller(installPath, reporter); const install = await installer.needsInstall(); if (install) {