Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

intellisense and code navigation gets very slow #2360

Closed
consititine opened this issue Feb 28, 2019 · 7 comments
Closed

intellisense and code navigation gets very slow #2360

consititine opened this issue Feb 28, 2019 · 7 comments

Comments

@consititine
Copy link

macOS High Sierra
vscode 1.31.1
when i use code navigation ,it takes about half minute to get the target function,which is too slow for me. I have uninstalled all the extentions but it seems doesn't work.
The feature works well in small project but slow in big project.Hoeever ,it works well too in my colleagues's mac。
Here is my setting.json:
{
"go.gopath": "/Users/yunzhanghu196/Desktop/workspace",
"window.zoomLevel": 1,
"files.autoSave": "afterDelay",
"workbench.colorTheme": "One Dark Pro Vivid",
"go.inferGopath": true,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"go.formatTool": "gofmt",
"go.useCodeSnippetsOnFunctionSuggest": true,
"typescript.useCodeSnippetsOnMethodSuggest": true,
"go.useCodeSnippetsOnFunctionSuggestWithoutType": true,
"go.autocompleteUnimportedPackages": true,
}
I would be grateful if any one can help

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Feb 28, 2019

  • Are you using Go modules?
  • Can you try the navigation in the editor and then compare that with running godef on the terminal? This way we can see if godef -t -f your-file-path -o offset itself is taking the time or if the extension is doing something wrong.

The godef tool will need offset which you can get by using the show-offset extension

@consititine
Copy link
Author

yes ,i am using go mod.
As your suggestion, i try to navigate by godef which takes minutes to get an result.
What's more, i don't get an result using the navigation in the editor,then it remind me to update my godef.

@ramya-rao-a
Copy link
Contributor

Do you get the result after updating godef as per the prompt?
After updating is there any difference in the speed in VS Code as well as when you try godef directly?

@ahmetb
Copy link

ahmetb commented Mar 4, 2019

Same issue here, when I use vscode-go with vgo projects it got unbearably slow to use intellisense (~10 seconds and mostly results in failure).

godef takes ~2 seconds for me (is it normal?):

$ time ~/gotools/bin/godef -t -f main.go -o 6037

/Users/ahmetb/go/pkg/mod/google.golang.org/[email protected]/health/grpc_health_v1/health.pb.go:174:6
NewHealthClient func(cc *ClientConn) HealthClient
~/gotools/bin/godef -t -f main.go -o 6037  0.68s user 0.91s system 78% cpu 2.028 total

@ramya-rao-a
Copy link
Contributor

@ahmetb That looks suspicious. Please log an issue in the repo for godef and loop in rogpeppe and ianthehat in the issue

@ahmetb
Copy link

ahmetb commented Mar 6, 2019

@ramya-rao-a
Copy link
Contributor

Closing this issue due to below reasons

  • An upstream issue has been logged for godef
  • We now recommend using the language server gopls when using modules.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants