redhat-developer / lsp4ij

LSP Client for IntelliJ
Eclipse Public License 2.0
113 stars 24 forks source link

Inconsistent diagnostics behaviour due to range #584

Open rcjsuen opened 1 month ago

rcjsuen commented 1 month ago
  1. If a language server specifies 1<<32 - 1 (4294967295) for diagnostic.range.end.character then it does not appear to work. I guess JetBrains still does not support this per this other claim from 2019. I understand that no consensus has been reached there but could this "known issue" be documented somewhere in this repository?

  2. If my diagnostics array has a) one valid diagnostic with a "non-crazy" range and b) a second diagnostic with said crazy range, neither of them will show up and I do not see a Received notification 'textDocument/publishDiagnostics' message in the "Traces" section. Why would the traces be filtered out? 🤔

angelozerr commented 1 month ago

I have tried to manage invalid range like vscode does.

Any contribution are welcome to improve it.

rcjsuen commented 1 month ago

I think I understand the issue now. The character must be a uinteger which the specification defines as 2^31 - 1 (2147483647) which is lower than 4294967295. So the conversion code is probably raising an exception or becoming a negative number somewhere. That's an issue with the language server which can be corrected on that end this but it does not quite explain why the "Traces" section is not showing the JSON-RPC notification at all. 🤔

angelozerr commented 1 month ago

Is not a problem coming from LSP4J (not LSP4IJ). Perhaps your issue is similar to https://github.com/redhat-developer/lsp4ij/issues/579 ?

rcjsuen commented 1 month ago

Thanks Angelo. Yeah, my guess is your comment here which I guess explains why the "Traces" section is empty.

Could we at least get a "Failed to deserialize JSON-RPC message" in the "Traces" section or something? That would have helped with debugging.

angelozerr commented 1 month ago

Could we at least get a "Failed to deserialize JSON-RPC message" in the "Traces" section or something?

I agree it would be nice but I don't know if it ispossible to do hat since the error comes from LSP4J.

That would have helped with debugging.

Any contribution are welcome!