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
TimSatke opened this issue Jul 30, 2019 · 4 comments
Closed

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

TimSatke opened this issue Jul 30, 2019 · 4 comments

Comments

@TimSatke
Copy link

@TimSatke TimSatke 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 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
@sylba2050

This comment has been minimized.

Copy link

@sylba2050 sylba2050 commented Aug 7, 2019

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

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Aug 7, 2019

@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

This comment has been minimized.

Copy link
Contributor

@stamblerre 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 stamblerre closed this Aug 8, 2019
@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Aug 8, 2019

Duplicate of #33003

@stamblerre stamblerre marked this as a duplicate of #33003 Aug 8, 2019
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
4 participants
You can’t perform that action at this time.