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/cmd/gopls: wrong error messages after gopls restart inside of editor (by means of editor) #32909

Closed
inliquid opened this issue Jul 2, 2019 · 9 comments

Comments

@inliquid
Copy link

@inliquid inliquid commented Jul 2, 2019

VS Code. After some editing I came to some strange error, and decided to restart gopls by means of editor But the thing is that after restart (no any other actions taken) there are false errors, see log below. This situation repeated each time restart feature was used (tried several times). However when I restarted whole editor, it disappeared.

[Info  - 2:01:42] Build info
----------
golang.org/x/tools/gopls v0.1.1
    golang.org/x/tools/gopls@(devel)
    golang.org/x/sync@v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
    golang.org/x/tools@v0.0.0-20190628153133-6cdbf07be9d0 => ../

Go info
-------
go version go1.12.6 windows/amd64

set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\***\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\***\go
set GOPROXY=
set GORACE=
set GOROOT=c:\go
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=c:\path\to\workdir\go.mod
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\***\AppData\Local\Temp\go-build772715294=/tmp/go-build -gno-record-gcc-switches

[Error - 2:01:45] unable to check package for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go: no packages found for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
[Error - 2:01:45] unable to check package for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go: no packages found for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
[Error - 2:01:49] unable to check package for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go: no packages found for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
[Error - 2:01:49] unable to check package for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go: no packages found for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
[Error - 2:01:49] Request textDocument/documentSymbol failed.
  Message: no AST for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
  Code: 0 
[Error - 2:01:49] unable to check package for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go: no packages found for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
[Error - 2:01:49] unable to check package for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go: no packages found for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
[Error - 2:01:49] unable to check package for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go: no packages found for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
[Error - 2:01:49] Request textDocument/codeAction failed.
  Message: no file information for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
  Code: 0 
[Error - 2:01:49] unable to check package for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go: no packages found for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
[Error - 2:01:49] unable to check package for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go: no packages found for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
[Error - 2:01:49] Request textDocument/documentLink failed.
  Message: no AST for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
  Code: 0 
[Error - 2:01:49] unable to check package for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go: no packages found for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
[Error - 2:01:49] unable to check package for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go: no packages found for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
[Error - 2:01:49] unable to check package for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go: no packages found for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
[Error - 2:01:49] Request textDocument/codeAction failed.
  Message: no file information for file:///c:/path/to/workdir/pkg/data/localcache/localcache.go
  Code: 0 
[Error - 2:01:51] unable to check package for file:///c:/path/to/workdir/pkg/server/handler/rest/registration.go: no packages found for file:///c:/path/to/workdir/pkg/server/handler/rest/registration.go
[Error - 2:01:51] unable to check package for file:///c:/path/to/workdir/pkg/server/handler/rest/registration.go: no packages found for file:///c:/path/to/workdir/pkg/server/handler/rest/registration.go
[Error - 2:01:51] unable to check package for file:///c:/path/to/workdir/pkg/server/handler/rest/registration.go: no packages found for file:///c:/path/to/workdir/pkg/server/handler/rest/registration.go
@gopherbot gopherbot added this to the Unreleased milestone Jul 2, 2019
@gopherbot gopherbot added the gopls label Jul 2, 2019
@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Aug 5, 2019

This sounds like your VSCode-Go issue: microsoft/vscode-go#2633. I will close this issue in favor of that one.

@stamblerre stamblerre closed this Aug 5, 2019
@inliquid
Copy link
Author

@inliquid inliquid commented Aug 6, 2019

It's clear that these issues are different. In the mentioned case there is even no gopls logs available.

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Aug 6, 2019

My apologies, I assumed that the error was related to one of the other issues you had filed.
Are you still seeing this issue with the latest version of gopls? We had a number of stability improvements with v0.1.3.
If you are seeing this with the latest version, please share the updated logs here.

@gopherbot
Copy link

@gopherbot gopherbot commented Sep 6, 2019

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 Sep 6, 2019
@inliquid
Copy link
Author

@inliquid inliquid commented Sep 6, 2019

Nice.

@jguenther
Copy link

@jguenther jguenther commented Sep 6, 2019

FWIW I haven't gotten this error in the past couple days. I've been keeping up to date with the latest gopls so maybe it got fixed there somewhere

@inliquid what version/commit of gopls are you using?

@ianthehat
Copy link

@ianthehat ianthehat commented Sep 6, 2019

I think it depends on how you restart gopls, if you use the Restart Language Server thing, it does not seem to clear out existing diagnostics, and of course the new instance of gopls knows nothing about the diagnostics that were already sent so it cannot clear them.
If you use the Reload Window option then it does not have this problem, but is a much more expensive operation.
I think this is a VSCode plugin bug not a gopls bug, but maybe we could find a way to work around it.

@inliquid
Copy link
Author

@inliquid inliquid commented Sep 6, 2019

Usually (if no errors, etc) "Restart Language Server" works. This is quite rare error and I didn't see it since quite a while.

@inliquid
Copy link
Author

@inliquid inliquid commented Sep 6, 2019

@jguenther I always use latest master version. Updating it regularly.

@golang golang locked and limited conversation to collaborators Sep 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.