x/tools/gopls: named return values with shared type cause incorrect highlighting #60589
Labels
FrozenDueToAge
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
gopls version
go env
What did you do?
I selected a return parameter of a multi-value function with two variables sharing a type definition (
salt
andkey
).What did you expect to see?
I expected the correct (
err
, fourth position) return values to be highlighted in the function body.What did you see instead?
The incorrect return values got highlighted instead.
I believe this happens because gopls does not differentiate (named) return values that share a type (declared as
var1, var2 type
).This does not appear to happen with function arguments.
Here's a video that better demonstrates the behavior when selecting different variables:
2023-06-03.17-38-43.mp4
Editor and settings
Visual Studio Code (no relevant settings)
Logs
No relevant logs that I could see.
The text was updated successfully, but these errors were encountered: