You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When exploring new codebases I often go to the definition of a method
just to find out that the method is actually a part of an interface.
I then use the “find implementations” action to find the implementation.
Often there is only one non-test implementation.
So, I would like to request a new action which would act like the
current one, but go to the definition of the only non-test interface
implementation if there is only one, or to the definition of the
interface if there are several.
The text was updated successfully, but these errors were encountered:
gopherbot
added
Tools
This label describes issues relating to any tools in the x/tools repository.
gopls
Issues related to the Go language server, gopls.
labels
Aug 5, 2020
ainar-g
changed the title
x/tools/gopls: go to the definitioin of the only non-test interface implementation
x/tools/gopls: go to the definition of the only non-test interface implementation
Aug 5, 2020
I've been wanting this myself for find-implementations and find-references as well. In particular, I want a way to only return non-test results for find-implementations and find-references.
By default it should work the way it does now since that is most correct and what people expect. That means we need an option to control gopls behavior. There is precedent for options in find-references with the "includeDeclaration", but there is no option for excluding tests.
I think in the short term this functionality would need to be implemented in the LSP client (i.e. the editor). For the long term we can open an LSP feature request to add a "excludeTests" option to find-implementations and find-references and see what they think. I looked briefly but didn't see any existing issues.
There is a wide range of operations that one might like to express that should be minor variation on a query such as References or Implementations, but unfortunately there is no general way to express these in the LSP or for a server to offer a menu of such commands. Custom client logic is required for each one, which is prohibitively expensive.
(Currently using v0.4.4 with Go 1.14.6.)
When exploring new codebases I often go to the definition of a method just to find out that the method is actually a part of an interface. I then use the “find implementations” action to find the implementation. Often there is only one non-test implementation.
So, I would like to request a new action which would act like the current one, but go to the definition of the only non-test interface implementation if there is only one, or to the definition of the interface if there are several.
The text was updated successfully, but these errors were encountered: