Skip to content

Inconsistent diagnostics behaviour due to range #584

Done

Description

@rcjsuen
  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? 🤔

Activity

  1. angelozerr commented on Oct 25, 2024

    @angelozerr
    Contributor

    I have tried to manage invalid range like vscode does.

    Any contribution are welcome to improve it.

  2. rcjsuen commented on Oct 25, 2024

    @rcjsuen
    ContributorAuthor

    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. 🤔

  3. angelozerr commented on Oct 25, 2024

    @angelozerr
    Contributor

    Is not a problem coming from LSP4J (not LSP4IJ). Perhaps your issue is similar to #579 ?

  4. rcjsuen commented on Oct 25, 2024

    @rcjsuen
    ContributorAuthor

    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.

  5. angelozerr commented on Oct 25, 2024

    @angelozerr
    Contributor

    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!

  6. added
    bug
    on Nov 20, 2024
  7. lagergren commented on Nov 24, 2026

    @lagergren
    Collaborator

    Part 2 of this issue, a message that LSP4J can't parse never showing in the LSP console's traces, is in #2213.

    Part 1 isn't LSP4IJ's to fix: 4294967295 is above LSP's maximum integer (2^31 − 1), so LSP4J can't parse the message. LSP4IJ already reads the spec's maximum as "end of line" (#1169), and with #2213 such a message at least shows in the traces, with the field and value that failed.

  8. lagergren commented on Nov 25, 2026

    @lagergren
    Collaborator

    Closing, as everything that LSP4IJ can do here is done:

  9. added this to the 0.30.2 milestone on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdiagnostic

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions