-
Notifications
You must be signed in to change notification settings - Fork 648
Go To Definition Not Working #966
Comments
|
I too am having this issue, I am unsure which version it began with. It previously did work, but hasn't for ~1-2 months. Mostly for in-built libraries (runtime, net/http, etc...) I do not have |
@erichiller Can you try setting |
@ramya-rao-a
I just tried to use By the way even if my |
@erichiller It is known issue that @bennyscetbun We use @bennyscetbun About the GOPATH issue, can you log a separate issue? |
@ramya-rao-a |
@bennyscetbun great that you are unblocked now. Happy Coding! @erichiller @mukeshdutt Do you still have issues with the Go to Definition feature? |
@ramya-rao-a Yes - Sorry for the delay - I just changed my config - Restarted vscode as well to include // vscode-go
// Run 'go build'/'go test -c' on save.
"go.buildOnSave": false,
// Run Lint tool on save.
"go.lintOnSave": true,
// "go.lintTool": "golint",
// Run 'go tool vet' on save.
"go.vetOnSave": true,
"go.formatOnSave": false,
"go.gotoSymbol.includeImports": true,
"go.useCodeSnippetsOnFunctionSuggest": true,
// Enable gocode's autobuild feature
"go.gocodeAutoBuild": true,
// Use gotype on the file currently being edited and report any semantic or syntactic errors found after configured delay.
"go.liveErrors": {
"enabled": true,
"delay": 500
},
"go.editorContextMenuCommands": {
"toggleTestFile": true,
"addTags": true,
"removeTags": false,
"testAtCursor": true,
"testFile": false,
"testPackage": false,
"generateTestForFunction": true,
"generateTestForFile": true,
"generateTestForPackage": false,
"addImport": true,
"testCoverage": true
},
"go.docsTool":"gogetdoc",
// "go.gopath": "C:\\Users\\ehiller\\dev\\",
// "go.toolsGopath": "C:\\Users\\ehiller\\dev\\",
// "go.goroot": "C:\\Users\\ehiller\\AppData\\Local\\omega\\system\\go\\"
"go.lintTool": "gometalinter",
"go.lintFlags": [
"--disable-all",
// "--enable=varcheck",
// "--enable=unused",
// "--enable=ineffassign"
// "--enable=goconst",
// "--enable=interfacer",
// "--enable=staticcheck",
// "--enable=dupl",
// "--enable=errcheck",
// "--enable=golint",
"--enable=gotype",
"--enable=vet",
"--enable=misspell"
// // "--enable=gocyclo",
// "--enable=goimports",
// "--enable=gosimple",
// "--enable=aligncheck",
// "--enable=deadcode",
// "--enable=ineffassign",
// "--enable=structcheck",
// // "--enable=unconvert"
], |
@erichiller So you are saying that "Go to Definition" is not working even after changing to |
@Emreu Thanks for investigating. Next time feel free to submit a PR as well. You have found the root cause, I'd prefer you get the credit for fixing the issue as well :) For now I have pushed in the fix. @erichiller @mukeshdutt I'll wait a few more days for you to confirm if your case is similar to @Emreu |
@ramya-rao-a Sorry for the delay in my case I'm sending dynamic value(variable) instead of hard coded. And now i changed go.docsTool value to gogetdoc after change this gogetdoc plugin was downloaded then again same go.useLanguageServer value to true after change the value same as go.useLanguageServer plugin tried to download but getting failed message. |
So you are saying setting Are you using multiple GOPATHs? |
When I use Visual Studio Code with Go exention or Atom with Go-plus, I got "No definition was found for 'Command'" error when trying to check declaration of the following code "&Cobra.Command". JetBrains' Gogland doesn't have this issue and can correctly jump to the Command(a struct) defintion. https://github.com/spf13/cobra/blob/master/cobra/cmd/add.go#L32
|
@hjma29 Can you try setting |
Thanks from prompt response. It works right away! Do we have plan to make "gogetdoc" as default or it has other issues comparing with godoc/godef? |
There is no current plan to make it default, but we can try it in one of the updates and see how it fares the larger audience |
We'll use #1025 to track the discussion around making @mukeshdutt We haven't heard back from you in a while, hopefully the problem is resolved. Closing this issue as the fix for the issue @Emreu is in master and will be out in the next update |
I had the same issue with: VS Code 1.14.1 (June 2017) Setting |
@AdiedX Thank you, that solved my problem! I'm using Windows here and useLanguageServer is not available but the setting needs to be activated to get the broken "Go to Definition F12" working again while using |
Hi,
I'm using golang with latest version of vscode and here i'm getting issue go to definition but the same thing is working fine in Sublime Text editor.
In src folder of my golang workspace here is multiple projects when trying to find same project function, struct etc. those are able to find but when I'm trying go to definition for another project stuff then below message is appeared.
No definition found for "function name".
The text was updated successfully, but these errors were encountered: