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

Repeated Diagnostic Messages in coc.nvim with Verible Language Server #2164

Open
TBD9rain opened this issue Apr 18, 2024 · 3 comments
Open
Labels
language-server Language server related issues

Comments

@TBD9rain
Copy link

My IDE is as following:

  • gvim (v9.0.1897) with coc.nvim (v0.0.82-84ce0312)
  • Verible Verilog Language Server built at v0.0-3638-ge3ef2a37

Repeated Warning Messages

The verible-verilog-ls configurations are as following:

"languageserver": {
        "verible":{
            "enable": true,
            "command": "verible-verilog-ls",
            "filetypes": ["verilog", "systemverilog"],
            "trace.server":"messages"
        }
    }

When I created a new .v file and typed several spaces, repeated identical warning messages popped up:

1713450713248

I expect a single warning message per actual issue per file change or analysis trigger.
After I configured the language server as following in coc.nvim, the second warning message dissapeared.

"languageserver": {
        "verible":{
            "enable": true,
            "command": "verible-verilog-ls",
            "filetypes": ["verilog", "systemverilog"],
            "disabledFeatures": ["diagnostics"], //  fix repeated identical messages bug
            "trace.server":"messages"
        }
    }

1713451208809

But I don't think this is an expected behavior or a long-term solution.

Log Messages

Logs of the preceeding different configurations are smilar except the message timestamps and durations.

[Trace - 22:45:20.639] Sending request 'initialize - (0)'.
Verible Verilog Language Server built at v0.0-3638-ge3ef2a37
commandline: C:/Program Files/Vim/vimfiles/languageserver/verible/verible-verilog-ls.exe 
[Trace - 22:45:20.647] Received response 'initialize - (0)' in 8ms.
[Trace - 22:45:20.647] Sending notification 'initialized'.
[Trace - 22:45:20.650] Sending notification 'workspace/didChangeConfiguration'.
[Trace - 22:45:20.650] Sending notification 'textDocument/didOpen'.
[Trace - 22:45:20.650] Sending request 'textDocument/diagnostic - (1)'.
[Trace - 22:45:20.651] Received notification 'textDocument/publishDiagnostics'.
[Trace - 22:45:20.651] Received response 'textDocument/diagnostic - (1)' in 1ms.
[Trace - 22:45:40.429] Sending notification 'textDocument/didChange'.
[Trace - 22:45:40.429] Sending request 'textDocument/diagnostic - (2)'.
[Trace - 22:45:40.429] Received notification 'textDocument/publishDiagnostics'.
[Trace - 22:45:40.430] Received response 'textDocument/diagnostic - (2)' in 1ms.
[Trace - 22:45:41.191] Sending notification 'textDocument/didChange'.
[Trace - 22:45:41.193] Sending request 'textDocument/diagnostic - (3)'.
[Trace - 22:45:41.194] Received notification 'textDocument/publishDiagnostics'.
[Trace - 22:45:41.195] Received response 'textDocument/diagnostic - (3)' in 2ms.

Verbose logs of the two configurations are also similar except the message timestamps and durations.

@TBD9rain TBD9rain added the language-server Language server related issues label Apr 18, 2024
@hzeller
Copy link
Collaborator

hzeller commented Apr 18, 2024

On every change of the file, the diagnostics are updated. It seems like your editor does not coalesce these ?

There are also two mechanisms diagnostics can be received:

  • the default by Verible is to publish new diagnostics whenever some change happens in the file (textDocument/publishDiagnostics)
  • It also seems that your editor is requesting diagnostics independently (textDocument/diagnostic), so maybe this is where things get merged and show up multiple times ? Is the "disabledFeatures" configuration switching the explicit request off ?

So things do look like they work as intended, just that the editor does not remove the duplicates.

I'll have a look if it is possible by the editor to request not auto-publishing diagnostics when it actually does the request by itself (maybe there is a setting the editor can send to the language server).

But you should probably also file an issue with your editors' language server implementation to make sure they coalesce the identical diagnostic messages properly or ignore diagnostic notifications when they already request

@TBD9rain
Copy link
Author

The "disabledFeatures" configuration doesn't switch the explicit request off. I think it just diabled one of the messages from diaplaing.

I will file an issue with the language server implementation plugin as well.

@fannheyward
Copy link

fannheyward commented Apr 19, 2024

Is the "disabledFeatures" configuration switching the explicit request off ?

The disabledFeatures made coc.nvim ignore publishDiagnostics one.

verible server files the capabilities with diagnosticProvider, coc.nvim will use pull mode to request to server for diagnostics.

I think the server shouldn't use both publishDiagnostics and diagnosticProvider at the same time, or use publishDiagnostics on document didOpen only, and pull mode for onSave and onChange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language-server Language server related issues
Projects
None yet
Development

No branches or pull requests

3 participants