x/tools/gopls: new buffer does not receive diagnostics when opened #42468
Labels
FrozenDueToAge
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
So I'm using gopls together with Neovim and CoC and I'm having a bit of trouble getting diagnostics to work as expected. When I open a file directly there is no issue and and can see in the logs that the client receives the diagnostics request. The problem is when I have first opened a file that have no errors and then open a new buffer in a vertical split, with a file that does have syntax errors. Here I doesn't get any diagnostics. I have to make an adjustment before I receive the diagnostics request from the language server.
This is my settings for the language server in CoC.
Here is a sample project that would replicate the issue.
a.go
c.go
So the flow looks like this.
c.go
a.go
in a new vertical splitWhat did you expect to see?
I expect to get diagnostics when opening a new buffer, but there is nothing. Only when I edit something does the diagnostics come. I can see that the only thing sent is
textDocument/didOpen
.This is how it looks when opening the vertical split.

After doing some small change (adding a line etc), now diagnostics come.

What did you see instead?
No diagnostics :(
The text was updated successfully, but these errors were encountered: