-
Notifications
You must be signed in to change notification settings - Fork 645
Go To Implementation #771
Comments
To get someone else started because my TypeScript is weak: the guru tool can handle this. It's already being used by this extension to find references. To search GOPATH for implementations of an interface (can be slow): It might be a good idea to allow the choice of scope between GOPATH (slow) or the currently opened project root including sub-folders. |
Hi @ramya-rao-a, @AlekSi I took a swing at this and got a working version here: as @nochso said, it is excruciatingly slow and vscode seems to be expecting a single result else it doesn't do anything. There is one reason am not sending a push request and that is because registerImplementationProvider and ImplementationProvider are missing in the vscode-extension-vscode library (atleast what is currently deployed on npm). I manually overwrote my local copy with one from vscode repo directly for it to work. This may be completely un-usable. Cheers!!! |
@codmajik That was quick! You can get the latest vscode.d.ts by updating the "engines" field in the Can you try using the |
@ramya-rao-a, I can try to be clever by figuring out the package, like so:
because go enforces folder structure it may works most of the times. warning: this may completely be needless Q: should it be restricted to interfaces because |
@codmajik go list might be what you're looking for:
However that would mean running another external command. I'll try to have a look at the implementation of |
Won't |
@ramya-rao-a it won't; I have been busy would get back to this in a few days. |
I think the current version of the extension already implements this feature. Am I right @ramya-rao-a? |
@zignd I think you are referring to the "Go to Definition" feature This one is about clicking on an interface and getting list of places where the interface has been implemented. |
@ramya-rao-a Oh, you're right. Sorry, my mistake. 😅 |
@codmajik ${workspaceRoot} strip the $GOROOT/src? |
@jackie-qiu ${workspaceRoot} is the full path of the folder opened in explorer. It is not computed. |
@codmajik So what you need is the import path. The same is needed for running |
I think
|
This feature is now out in the latest update to the Go extension 0.6.64. Thanks everyone! |
VS Code 1.9 introduced Go To Implementation command. Go plugin should support it.
The text was updated successfully, but these errors were encountered: