-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: diagnostics should be resent when a file is closed via textDocument/didClose and subsequently reopened with textDocument/didOpen #50267
Comments
Thanks for the report. I agree this is a misbehavior on our part. Marking it for the next release. |
I'm also experiencing this issue in neovim 0.8.0 gopls -v version
|
Thanks for the signal boost. This should be an easy fix, so I'll prioritize for v0.9.0 (the next release). |
Just following up: unfortunately this didn't make v0.9.0, and v0.9.1 was a bugfix release for a specific regression, but this will be in v0.9.2. Sorry for the delay getting this out. |
Change https://go.dev/cl/420539 mentions this issue: |
Just confirming: this will be fixed in the next gopls release (v0.9.2) scheduled for next week. If someone wants to confirm that this fixes the specific neovim bug that led to this issue, that would be awesome. Just need to install gopls from tip:
Thanks all for your patience. This issue was filed during the Go 1.18 crunch, and so took longer to fix that would be ideal... |
I followed the case because I also experience the diagnostics disappearing after saving a buffer and it only re-appear when adding newlines again. With the master gopls it seems like this was addressed. It looks like the inline diagnostics text appears when editing a buffer, and gets repainted when the buffer is saved. This was checked with:
|
@jmarais thank you for confirming. |
gopls version
❯ gopls -v version
Build info
gopls, built in GOPATH mode master
gopls, built in GOPATH mode@master
go env
❯ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/michael/.cache/go-build"
GOENV="/home/michael/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/michael/.local/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/michael/.local/go"
GOPRIVATE=""
GOPROXY="direct"
GOROOT="/usr/lib/golang"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16.11"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/michael/Repositories/neovim_development/neovim-worktree/neovim/go.mod"
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-build1161291752=/tmp/go-build -gno-record-gcc-switches"
What did you do?
Sent
textDocument/didClose
followed bytextDocument/didOpen
What did you expect to see?
For most language servers, they will immediately re-send diagnostics as this is equivalent to opening a new file. See pyright:
With gopls, no notification is sent:
What did you see instead?
I would expect diagnostics to be sent when opening the file, as they are on the first textdocument/didOpen request. This is consistent with other language servers.
Please see neovim/neovim#16623 (comment) for context.
Editor and settings
Neovim 0.6.0.
Logs
See above for the RPC messages.
The text was updated successfully, but these errors were encountered: