csharp-language-server icon indicating copy to clipboard operation
csharp-language-server copied to clipboard

Errors not showing up until I open file where error occurs

Open marcinjahn opened this issue 1 year ago • 1 comments

I noticed that csharp-ls will not show me errors in my repository until I open the files with issues manually. E.g., if I change the name of some class (without using LSP rename feature), and that class is being instantiated in other files, I will not get any errors until I start opening each one of these other files.

Is it an expected behavior? In solutions with tens of projects, it's quite inconvenient.

I'm using csharp-ls with Neovim and the https://github.com/Decodetalkers/csharpls-extended-lsp.nvim.

marcinjahn avatar Jun 25 '24 19:06 marcinjahn

Can confirm I can see this on VS Code, at the very least. The issue is that csharp-ls does not implement the "workspace/diagnostic" LSP request and thus client is left to its own devices to accumulate diagnostics from the server as it sends them only for files that have been open recently.

TODO: implement https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_diagnostic

razzmatazz avatar Jul 02 '24 13:07 razzmatazz

Related PR: https://github.com/razzmatazz/csharp-language-server/pull/235

razzmatazz avatar Jun 17 '25 18:06 razzmatazz

A fix for this has been released in https://github.com/razzmatazz/csharp-language-server/releases/tag/0.18.0 -- please report if this does not fix your issue!

razzmatazz avatar Jun 23 '25 06:06 razzmatazz