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: reconsider removing the annotations setting #71888

Open
anderseknert opened this issue Feb 21, 2025 · 2 comments
Open

x/tools/gopls: reconsider removing the annotations setting #71888

anderseknert opened this issue Feb 21, 2025 · 2 comments
Labels
gopls Issues related to the Go language server, gopls. ToolProposal Issues describing a requested change to a Go tool or command-line program. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@anderseknert
Copy link

anderseknert commented Feb 21, 2025

Having done a bunch of work to reduce heap allocations in some of the projects I'm involved in recently, the GC details feature has been incredibly helpful to me. While there are of many tools to help with this (and I'm sure, opinions on which ones to use), I've found that at least for me the combination of profiling (to identify hot spots and major bottlenecks) and VS Code + gopls to quickly get an overview of allocations in files I'm working in, has been close to perfect for what I've been trying to accomplish.

v0.18.0 made this feature available as a code action rather than a code lens, which I don't mind at all. However, the removal of the configuration toggles for the available GC detail types more or less broke this feature completely for my use case. With the exception of the function inlining detail — which I've enabled occasionally as needed — the other details have not been particularly interesting for my purposes. More problematic than them being of lesser interest to me is however the fact that seeing all GC details reported is really noisy... Noisy to the point where I no longer can use the feature for what I've used it for (and again, enjoyed using it for!), i.e. to quickly identify sources of heap allocations.

Image

Another unfortunate side-effect of all GC details now being reported is that I now frequently hit the limit for total issues reported in a file (which for VS code seems to be 1000 issues). While few of the files I work on have had 1000+ allocations reported, many of them hit the limit when all details contribute to the count, and even quite early in some files. This means that even if I could learn to live with the noise of the details I don't care much about, many issues I do care about are no longer visible at all.

Attached image is one example of a file where I previously would see issues reported all over the minimap (to the end of file), but where now only 1/3 of the file or so is covered.

I hope you can consider either restoring the configuration options from previous versions, or to allow the GC detail options to be toggled by other means.

Image

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Feb 21, 2025
@gopherbot gopherbot added this to the Unreleased milestone Feb 21, 2025
@gabyhelp
Copy link

Related Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

@gabyhelp gabyhelp added the ToolProposal Issues describing a requested change to a Go tool or command-line program. label Feb 22, 2025
@findleyr
Copy link
Member

Thanks for filing this issue. CC @adonovan

I think we can reinstate the configuration option, given that it serves a real need.

@findleyr findleyr modified the milestones: Unreleased, gopls/v0.18.2 Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls. ToolProposal Issues describing a requested change to a Go tool or command-line program. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants