Skip to content

Commit

Permalink
(GH-618) Add checkForUpdates setting
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
glennsarti committed May 4, 2021
1 parent 831c6a2 commit 283b0d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@
"default": false
}
}
},
"terraform.checkForUpdates": {
"type": "boolean",
"default": true,

"description": "Automatically check for Terraform Language Server Updates."
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 283b0d1

Please sign in to comment.