Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an option to disable language server upgrade checks #618

Closed
willhughes-au opened this issue Apr 30, 2021 · 11 comments · Fixed by #620
Closed

Provide an option to disable language server upgrade checks #618

willhughes-au opened this issue Apr 30, 2021 · 11 comments · Fixed by #620
Labels
enhancement New feature or request

Comments

@willhughes-au
Copy link

For the the last 10 hours or so, I've been getting repeated notifications to upgrade to 0.16.0
I'll switch windows, or lock/unlock my machine and again, there will be the prompt. Sometimes several of them.

"A new langauge server release is availale: 0.16.0. Install now?"

I don't want to install it.
I want it to shut up and stop bugging me. I've had to disable the extension just be able to get work done.

Yesterday it was fine, today something has changed and now it's an incessant pestering.

Please provide an option to either disable the upgrade checks entirely, or an option to suppress the prompts.

@radeksimko
Copy link
Member

Hi @willhughes-au
There is an option to disable the LS in the command palette, have you tried it?

Screenshot 2021-04-30 at 07 07 40

@glennsarti
Copy link
Contributor

That seems like an over-reaction. Disabling the entire language server due to an update message?

#595

Honestly, I think it's a bug

https://github.com/hashicorp/vscode-terraform/blob/main/src/extension.ts#L169-L171

The code says every 24hrs, but the delay looks wrong.

Should be 1000 x 60 x 60 x 24
1000ms in a second
60 seconds in a minute
60 minutes in an hour
24 hours in a day

The current value of 1000 * 60 * 24 will check every 24 minutes

@rockdreamer
Copy link

I got three notifications for the same upgrade that would not go away. In the end, I had to kill the VSCode process tree. Not an over-reaction. It's quite suboptimal UX.

@aeschright
Copy link
Contributor

I just put out a patch release that will bring those install attempts down to the intended once a day rate -- thanks to @glennsarti for doing the fix!

We don't have anything in the works right now for letting people skip an update until the next version, which sounds like it would be helpful for some of you. I'd be open to someone doing a PR on that, though, so let us know if you're interested.

@aeschright
Copy link
Contributor

One other note: if you want to pin the language server to a particular release and keep the installer from checking for updates, you can install terraform-ls manually and set "pathToBinary" with the full executable path.

@glennsarti
Copy link
Contributor

glennsarti commented May 4, 2021

Not an over-reaction.

Sorry @rockdreamer I may not have said that correctly. I meant that it's bad that the workaround for too many update notifications is to turn off the entire language server.

@glennsarti
Copy link
Contributor

@aeschright I may have a go at a PR to add a "disable update checks" setting. But I think I can also see some problems with the current implementation which may trip some people up.

glennsarti added a commit to glennsarti/vscode-terraform that referenced this issue May 4, 2021
Previously the extension would trigger a new auto-update whenever it was
activated. However this can causes issues when a user deactivates-activates the
language server quickly multiple times, as it cause multiple timeouts to be
created. Additionally, when disabled, it would not clear any active timeouts.

This commit adds a small wrapper around the setTimeout function to track usage.
In particular, it will silently ignore calls to add a timeout if a timeout is
already active.  This commit also clears any timeouts when the language server
is disabled.
glennsarti added a commit to glennsarti/vscode-terraform that referenced this issue May 4, 2021
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.
@glennsarti
Copy link
Contributor

@aeschright PR is up.

@radeksimko radeksimko added enhancement New feature or request and removed question labels May 5, 2021
@carlpaten
Copy link

carlpaten commented Aug 3, 2021

Just like everyone else I'm trying to manage the notification spam in my life. At this point I'll probably end up ditching vscode-terraform over this.

In #623 @radeksimko writes

However I feel the checkForUpdates is worth further discussion. Partially for the reasons that @aeschright mentioned - i.e. we do not want people to just turn off updates and forget about it, or make it too difficult to turn back on. Updates may contain security patches which are important.

vscode-terraform is the only language server I've ever used to nag me about updates multiple times a month. I understand it does slightly more than e.g. OmniSharp but when the description says "syntax highlighting and autocompletion for Terraform" I think most people expect it to slot into their workflow the way a regular language server would.

@radeksimko
Copy link
Member

@LilRed I would be open to a PR which adds a config option to make updates silent and suppress the notifications - would that address your concerns?

@jpogran
Copy link
Contributor

jpogran commented Jan 5, 2022

We have a similar request reported in #783.

In #868 we configured the extension to silently install the terraform-ls binary without prompting the user. This is currently released in the preview extension if you would like to try this out now. We will be releasing this to stable in the near future.

We are also close to implementing #820, which will bundle the terraform-ls binary inside the extension, so the extension does not have to download the terraform-ls binary at runtime.

I'm going to lock and close this issue now. Please do open a new issue if the new features we've recently released do not work for you.

@jpogran jpogran closed this as completed Jan 5, 2022
@hashicorp hashicorp locked and limited conversation to collaborators Jan 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants