x/tools/gopls: new buffer does not receive diagnostics when opened #42468
Comments
Also, do you have a /cc @findleyr for more advice about Neovim and CoC |
The diagnostic is there: you should be able to see it via gopls sends the diagnostic on workspace load, and doesn't re-send it after the didOpen. @stamblerre that matches your expectation, right? |
Yeah, sorry, I just meant that |
Oh okay, I can see that the diagnostic are being sent when I can confirm that Nothing wrong with |
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: