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: language server stops working at valid file with "has errors, skipping type-checking" #32855

Closed
inliquid opened this issue Jun 29, 2019 · 14 comments

Comments

@inliquid
Copy link

@inliquid inliquid commented Jun 29, 2019

VS Code, see screenshot:
изображение
These messages appear infinitely with gopls simply not working. File is valid, btw (but even if it was not, how am I supposed to work? non-sense if it can only work with files with no errors).

Tried both @latest and @master.

@gopherbot gopherbot added this to the Unreleased milestone Jun 29, 2019
@gopherbot gopherbot added the gopls label Jun 29, 2019
@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Jul 1, 2019

We should probably improve that error message, but that means that there were errors determining the files and dependencies for the package. Are you opening VSCode from the root of your module?

@inliquid

This comment has been minimized.

Copy link
Author

@inliquid inliquid commented Jul 1, 2019

Yes, VS Code workspace is at the root of module.

@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Jul 1, 2019

I know you updated to master, as per our discussion on your other issue. Do you still see these errors on master? If so, what is the output of go list -e -json -compiled -test /absolute/path/to/your/package?

@inliquid

This comment has been minimized.

Copy link
Author

@inliquid inliquid commented Jul 1, 2019

I'll test and report.

@stamblerre stamblerre changed the title x/tools/cmd/gopls: language server stops working at valid file with "has errors, skipping type-checking" x/tools/gopls: language server stops working at valid file with "has errors, skipping type-checking" Jul 2, 2019
@zouyee

This comment has been minimized.

Copy link

@zouyee zouyee commented Aug 3, 2019

for GOROOT=/usr/local/go GOPATH=/Users/xxx/Code/golang GO111MODULE=on PWD=/Users/xxx/Code/golang/src/k8s.io/kubernetes go "list" "-e" "-json" "-compiled=true" "-test=true" "-export=false" "-deps=true" "-find=false" "--" "/Users/xxx/Code/golang/src/k8s.io/kubernetes/pkg/kubelet/lifecycle", stderr: <<>>

[Error - 3:12:38 PM] Request textDocument/codeAction failed.
  Message: GetAST: unable to check package for file:///Users/xxx/Code/golang/src/k8s.io/kubernetes/pkg/kubelet/lifecycle/predicate.go: package k8s.io/kubernetes/pkg/kubelet/lifecycle has errors, skipping type-checking

same issue

@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Aug 5, 2019

@zouyee: Please open a new issue, along with the information described here. In your case, please also add the output of go list -e -json -compiled -test /absolute/path/to/your/package. Thanks!

@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Aug 5, 2019

@inliquid: Is this still an issue for you?

@inliquid

This comment has been minimized.

Copy link
Author

@inliquid inliquid commented Aug 6, 2019

@stamblerre it is.

@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Aug 6, 2019

@inliquid: What is the output of gopls -rpc.trace -v check /path/to/file.go?

@inliquid

This comment has been minimized.

Copy link
Author

@inliquid inliquid commented Aug 6, 2019

I will check when I have time to.

@cardonator

This comment has been minimized.

Copy link

@cardonator cardonator commented Aug 24, 2019

I'm having a similar problem to the above in gopls with a module package.

If I run gopls -rpc.trace -v check /home/bcardon/dev/app/package/base.go the output I get is:

----------
version v0.1.0, built in $GOPATH mode

Go info
-------
go version go1.12.9 linux/amd64

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/bcardon/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/bcardon/go"
GOPROXY=""
GORACE=""
GOROOT="/snap/go/4301"
GOTMPDIR=""
GOTOOLDIR="/snap/go/4301/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build355155299=/tmp/go-build -gno-record-gcc-switches"
2019/08/24 12:07:45 Error:unable to check package for file:///home/bcardon/dev/app/package/base.go: no packages found for /home/bcardon/dev/app/package/base.go
2019/08/24 12:07:46 Error:unable to check package for file:///home/bcardon/dev/app/package/base.go: no packages found for /home/bcardon/dev/app/package/base.go
2019/08/24 12:07:46 Error:failed to deliver diagnostic for file:///home/bcardon/no%20packages%20found%20for%20/home/bcardon/dev/app/package/base.go: stat /home/bcardon/no packages found for /home/bcardon/dev/app/package/base.go: no such file or directory
check: timed out waiting for results from file:///home/bcardon/dev/app/package/base.go

edit: Nevermind, the issue I found was that one of the files in my package had the wrong package name. It would be nice if there was a way for gopls to detect that issue.

@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Aug 24, 2019

@cardonator: it looks like you are also using an old version of gopls. You can upgrade by running “GO111MODULE=on go get golang.org/x/tools/gopls@latest”.

@cardonator

This comment has been minimized.

Copy link

@cardonator cardonator commented Aug 24, 2019

Ah, thanks for the command. I could tell I was on an old version but not why it wasn't updating. 👍

@gopherbot gopherbot added the Tools label Sep 12, 2019
@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Nov 1, 2019

This issue seems to be fairly old and a lot has changed in gopls since it was filed. I'm going to close it, but please open a new issue if you encounter problems with gopls.

@stamblerre stamblerre closed this Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.