-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: jump to definition on 'return' should go to the result parameter list #70462
Comments
This would be also nice for |
@mateusz834 we can do that too. I think whenever there is an obvious possible result for an LSP operation at a position, we should return it. It is a good UX when more operations work, more of the time. |
How about make hover works for return to show function signature. |
That's a great idea, too. Hover is probably more useful than definition, actually, but we can do both. |
Hmm, although I do find that hover to be distracting in some editors. In my editor, I make it a manual operation, bound to a keystroke. I wonder if we should be cautious about popping up hover dialogs over everything. |
In fact, gopls is already conservative in hover -- rust-analyzer shows definition for every keyword. |
Change https://go.dev/cl/636855 mentions this issue: |
Enables you to use the definition operation on a return token and brings you to the return parameters. Updates golang/go#70462 Change-Id: I080ff37aad5ac1498e320429fad6dd4b043f02c8 Reviewed-on: https://go-review.googlesource.com/c/tools/+/636855 Auto-Submit: Madeline Kalil <mkalil@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Alan Donovan <adonovan@google.com>
Finished "jump to definition" for return statements, will work on break/goto/continue next |
Change https://go.dev/cl/637476 mentions this issue: |
Change https://go.dev/cl/637818 mentions this issue: |
Hovering over a return statement now reveals the result type of the function. Updates golang/go#70462 Change-Id: Ib15c0b3db52311762f021a514c0db7bd71411eb3 Reviewed-on: https://go-review.googlesource.com/c/tools/+/637476 Reviewed-by: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Findley <rfindley@google.com>
Frequently, when I'm looking at a return statement, I want to jump to the function signature.
In the category of "more LSP operations should work, more of the time", we could make jump to definition on a return statement go to the result parameter list.
The text was updated successfully, but these errors were encountered: