golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
124.21k stars 17.7k forks source link

x/tools/gopls: jump to definition on 'return' should go to the result parameter list #70462

Open findleyr opened 1 day ago

findleyr commented 1 day ago

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.

mateusz834 commented 20 hours ago

This would be also nice for break and continue, maybe goto, but not realy needed, because we can always go to definition of the label (it is required).

findleyr commented 14 hours ago

@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.