Skip to content

Add option to suppress parameter name inlay hint when argument matches name #2361

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

Closed
zombiezen opened this issue Jul 20, 2022 · 3 comments
Closed

Comments

@zombiezen
Copy link

zombiezen commented Jul 20, 2022

I noted on Twitter for the new inlay hint feature:

The Rust language server has a nice subtle touch where if the parameter name matches the argument variable given, it skips showing the inlay.

And @hyangah noted in #1631 (comment)_:

It looks like Javascript/Typescript have similars, e.g. javascript.inlayHints.parameterNames.suppressWhenArgumentMatchesName

Adding this option would be great for common parameters like ctx context.Context.

@gopherbot gopherbot added this to the Untriaged milestone Jul 20, 2022
@jamalc jamalc modified the milestones: Untriaged, vscode-go/later Jul 22, 2022
@jamalc jamalc added FeatureRequest gopls gopls related issues and removed gopls gopls related issues labels Jul 22, 2022
@jamalc jamalc modified the milestones: vscode-go/later, v0.36.0 Jul 22, 2022
@suzmue suzmue self-assigned this Jul 26, 2022
@AngelDemoni

This comment was marked as off-topic.

@AngelDemoni

This comment was marked as off-topic.

@suzmue
Copy link
Contributor

suzmue commented Aug 11, 2022

The latest gopls version suppresses parameter name inlay hints when the argument matches the name (for example, ctx and id match the parameter names below):

Screen Shot 2022-08-11 at 11 20 46 AM

@suzmue suzmue closed this as completed Aug 11, 2022
@suzmue suzmue modified the milestones: v0.36.0, v0.35.2 Aug 11, 2022
@golang golang locked and limited conversation to collaborators Aug 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants