Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autocomplete is slow #292

Closed
MetaMmodern opened this issue Jul 5, 2020 · 8 comments
Closed

autocomplete is slow #292

MetaMmodern opened this issue Jul 5, 2020 · 8 comments

Comments

@MetaMmodern
Copy link

@MetaMmodern MetaMmodern commented Jul 5, 2020

What version of Go are you using (go version)?

$ go version
1.14.4

Does this issue reproduce with the latest release?

Idk.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Bunyamin\AppData\Local\go-build
set GOENV=C:\Users\Bunyamin\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\Bunyamin\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\Bunyamin\AppData\Local\Temp\go-build068588934=/tmp/go-build -gno-record-gcc-switches

What did you do?

Just install the add-on and try using autocomplete.

What did you expect to see?

No lags.

What did you see instead?

Freezes and lags)
image
Here on the screenshot you can see, that the add-on doesn't give fast response and shows "Loading...". During such behaviour whole system starts to lag and work slowly until some info about autocomplete is shown. It is very uncomfortable when you try using fast autocomplete and arrows to choose the function(structure/type/etc) you need. While writing code on html/js/css there is no such behaviour.

@thepudds
Copy link

@thepudds thepudds commented Jul 5, 2020

Thanks for filing this issue, and sorry that you seem to have hit some problems.

The gopls troubleshooting guide has some very useful instructions for how to gather data for reporting a problem, including how to gather logs:

https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md

Could you take a look at that troubleshooting guide and follow the steps outlined there?

@MetaMmodern
Copy link
Author

@MetaMmodern MetaMmodern commented Jul 5, 2020

Thanks for filing this issue, and sorry that you seem to have hit some problems.

The gopls troubleshooting guide has some very useful instructions for how to gather data for reporting a problem, including how to gather logs:

https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md

Could you take a look at that troubleshooting guide and follow the steps outlined there?

Hi, sorry, but I don't know what gopls is and as I understood this is a program for logging Golang issues. However, my problem is connected not to the language itself, but to the extension, provided by Google Team in VSCode Marketplace. I just don't know where can I open such thread for VSCode extension, so I opened it here.
But again, maybe I misundrestood,

@thepudds
Copy link

@thepudds thepudds commented Jul 5, 2020

Hi @MetaMmodern, sorry, I probably jumped ahead.

In terms of what is gopls, here is a summary from the Language Server section of the VS Code Go Extension README:

In the default mode, the Go extension relies upon a suite of command-line tools. A new alternative is to use a single language server, which provides language features through the Language Server Protocol.

The Go team at Google has developed gopls, which is the official Go language server. It is currently in an alpha state and under active development.

gopls is recommended for projects that use Go modules.

To opt-in to the language server, set "go.useLanguageServer" to true in your settings. You should then be prompted to install gopls. If you are not prompted, you can install gopls manually by running the Go: Install/Update Tools command and selecting gopls.

One question would be whether or not you are using Go Modules?

Backing up, it likely would help if you could also provide the information requested for example in #281 (comment), especially the additional version and setting questions listed there.

@MetaMmodern
Copy link
Author

@MetaMmodern MetaMmodern commented Jul 5, 2020

Hi, @thepudds
Okay, I've understood, I'll try using gopls and live server instead of command-line tools. Currently I'm using the latest available version of VSCode(can't check right now, but will send asap) and I don't (I think i don't) use Go Modules. Anyway, I'll provide you with additional information if necessary after i check if gopls is enabled. Thank you🤗

@hyangah
Copy link
Contributor

@hyangah hyangah commented Jul 6, 2020

Since this is the vscode go extension issue, I am transferring this issue to its own repo.
@MetaMmodern Please provide the vscode go extension settings: "Command Palette" -> "Preferences: Open Settings (JSON)" -> any settings fields starting with "go", "[go]", "gopls" prefixes.

If you find "go.useLanguageServer": true in the settings, please capture the logs following the instruction in https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md#vs-code when you are experiencing the issues. Thanks!

@hyangah hyangah transferred this issue from golang/go Jul 6, 2020
@hyangah hyangah changed the title Visual Stido Code Add-On works bad autocomplete is slow Jul 6, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented Aug 6, 2020

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@gopherbot gopherbot closed this Aug 6, 2020
@codecat
Copy link

@codecat codecat commented Aug 23, 2020

One question would be whether or not you are using Go Modules?

I'm not the issue submitter, but I'm noticing some heavy autocompletion delays since adding Go Modules to my project. Prior to that, everything was super fast and snappy. Is this a known problem?

Edit: Just found out my VS Code actually wasn't using gopls, despite me thinking it was.. enabling it in the settings made it a lot faster. 👍

@MetaMmodern
Copy link
Author

@MetaMmodern MetaMmodern commented Aug 25, 2020

One question would be whether or not you are using Go Modules?

I'm not the issue submitter, but I'm noticing some heavy autocompletion delays since adding Go Modules to my project. Prior to that, everything was super fast and snappy. Is this a known problem?

Edit: Just found out my VS Code actually wasn't using gopls, despite me thinking it was.. enabling it in the settings made it a lot faster. 👍

Great, i'm not using go and go extensions anymore but i'm glad that you found a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.