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

x/tools/gopls: cannot handle large files #33372

Closed
tsatke opened this issue Jul 30, 2019 · 4 comments
Closed

x/tools/gopls: cannot handle large files #33372

tsatke opened this issue Jul 30, 2019 · 4 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@tsatke
Copy link

tsatke commented Jul 30, 2019

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

$ go version
go version go1.12.5 darwin/amd64

go version go1.12.7 darwin/amd64

$ gopls version
version v0.1.3, built in $GOPATH mode

Does this issue reproduce with the latest release?

Yes, but differently

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

go env 1.12.5 Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/user/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/user/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12.5/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12.5/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/44/txz_wqq568n4lbh6014ft754hlbqxb/T/go-build952763620=/tmp/go-build -gno-record-gcc-switches -fno-common"
go env 1.12.7 Output
$go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/user/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/user/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12.7/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12.7/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/44/txz_wqq568n4lbh6014ft754hlbqxb/T/go-build057133603=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

1.12.5

I generated a 120k LOC with ANTLR, containing some actions (basically code that ANTLR copies from its grammar directly into the code).
I have to implement these actions in a separate file in the same package.
Every time this actions-file is changed and saved, gopls tries to reload the large (unchanged, generated) file, and thus autocompletion on any file is stuck for 10-20 seconds, after what

[Error - 8:49:39 PM] unable to check package: context canceled
	file = file:///Users/user/Development/github.com/gojisvm/gojis/internal/parser/antlr_actions.go

is printed multiple times, but the autocompletion does work again.

1.12.7

Does not print an error, but autocompletion is still stuck for at least 10 seconds.

What did you expect to see?

Pretty much that, but I would like a way to make gopls ignore specific - or in general, generated - files.

What did you see instead?

A practically unusable autocompletion while the file is reloaded.

Maybe related

#33221 , I installed latest instead of master, but it didn't solve the issue (for neither version).

@gopherbot gopherbot added this to the Unreleased milestone Jul 30, 2019
@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Jul 30, 2019
@stamblerre stamblerre changed the title x/tools/cmd/gopls: Large/Generated files are reloaded on change of other file in package x/tools/gopls: large files slow type-checking Aug 5, 2019
@stamblerre stamblerre changed the title x/tools/gopls: large files slow type-checking x/tools/gopls: cannot handle large files Aug 5, 2019
@stamblerre stamblerre added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 5, 2019
@sylba2050
Copy link

Hi, Please set GO111MODULE=on and you can use go get golang.org/x/tools/gopls@latest for get gopls.
gopls version version v0.1.3, built in $GOPATH mode is probably obtained when GO111MODULE is off.

@stamblerre
Copy link
Contributor

@sylba2050: This issue persists regardless of the version of gopls, so I don't think it would matter if the version of gopls is built in $GOPATH mode or not.

Thanks for reporting @TimSatke, I'll investigate this when I have a chance.

@stamblerre
Copy link
Contributor

stamblerre commented Aug 8, 2019

After some investigation of #33003, it seems like this issue is quite similar. Closing in favor of that issue.

@stamblerre
Copy link
Contributor

Duplicate of #33003

@stamblerre stamblerre marked this as a duplicate of #33003 Aug 8, 2019
@golang golang locked and limited conversation to collaborators Aug 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants