vscode-go icon indicating copy to clipboard operation
vscode-go copied to clipboard

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

Open zombiezen opened this issue 3 years ago • 2 comments

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 https://github.com/golang/vscode-go/issues/1631#issuecomment-1155185811_:

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.

zombiezen avatar Jul 20 '22 15:07 zombiezen

#2365

AngelDemoni avatar Jul 27 '22 08:07 AngelDemoni

  • [x] # Duplicate of #

AngelDemoni avatar Jul 27 '22 08:07 AngelDemoni

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 avatar Aug 11 '22 15:08 suzmue