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

x/tools/gopls: improve experience when editing a go.mod file by hand #42529

Closed
stamblerre opened this issue Nov 12, 2020 · 3 comments
Closed

x/tools/gopls: improve experience when editing a go.mod file by hand #42529

stamblerre opened this issue Nov 12, 2020 · 3 comments
Assignees
Labels
Milestone

Comments

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Nov 12, 2020

Right now, we invalidate metadata on every keystroke, and for a go.mod file, that means that the metadata for the entire workspace is invalidated as you type. This triggers a go list on every keystroke, causing CPU usage to spike. We need to improve the UX of editing a go.mod file by hand, and that likely will be resolved by only invalidating metadata on go.mod saves, not edits.

#42266 might also be helpful, though I don't think it's the critical issue.

@stamblerre stamblerre added this to the gopls/vscode-go milestone Nov 12, 2020
@stamblerre stamblerre added this to Needs Triage in vscode-go: gopls by default Nov 12, 2020
@stamblerre stamblerre moved this from Needs Triage to Critical in vscode-go: gopls by default Nov 12, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented Nov 18, 2020

Change https://golang.org/cl/271299 mentions this issue: internal/lsp/cache: only invalidate metadata for go.mod files on save

vscode-go: gopls by default automation moved this from Critical to Done Nov 20, 2020
@stamblerre stamblerre reopened this Dec 17, 2020
vscode-go: gopls by default automation moved this from Done to In progress Dec 17, 2020
@stamblerre stamblerre modified the milestones: gopls/v0.5.4, gopls/v0.6.2 Dec 17, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented Dec 17, 2020

Change https://golang.org/cl/279033 mentions this issue: gopls/internal/regtest: test metadata validation only on save for go.mod

gopherbot pushed a commit to golang/tools that referenced this issue Dec 17, 2020
There was never a test that actually confirmed that golang/go#42529 was
fixed, so it never actually was.

Updates golang/go#42529

Change-Id: I4264162e98c5fde804c780e098a1d4e21a2d88d8
Reviewed-on: https://go-review.googlesource.com/c/tools/+/279033
Trust: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
@findleyr findleyr self-assigned this Dec 23, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented Dec 23, 2020

Change https://golang.org/cl/279720 mentions this issue: internal/lsp/cache: only reload the workspace on saved changes

vscode-go: gopls by default automation moved this from In progress to Done Dec 23, 2020
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Jan 12, 2021
Features

Shadow analyzer

This off-by-default analyzer flags shadowed variables. Learn more
in the Analyzers documentation.

Experimental

New keys for the GC details "annotations" setting

The previous keys were prefixed with "no" and meant to disable
certain GC details checks, which was inconsistent with the style
of our other settings maps. A warning will appear suggesting a
change to the new key name, but the old settings will continue to
work. Full details can be found in the annotations documentation.

Documentation

Improved documentation for available analyzers.

Improved documentation for Vim.

Fixes

Editing the go.mod file by hand (golang/go#42529)

This issue was previously marked as resolved, but it had not actually
been fixed. Package metadata will now only be invalidated when a
go.mod file is saved, so you will need to save before expecting
your changes to be propagated. This should significantly reduce
the number of go list calls (and therefore CPU utilization) as you
edit the go.mod file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.