Skip to content

Overflow value(exceeding uinteger) passed into jsonrpc but still work #1574

Open

Description

@He1pa

The reason is that I found that the fmt feature of my lsp server cannot be used in IntelliJ, but it still work in vscode.
After investigation, I found that I assigned a u32:Max to formatResponse.textedit.range.line in the format's Response
I implemented the lsp server in rust, and u32 was used as the range type in rust's lsp-type, but the range of this value in lsp should be 0-2^31 -1. I think this is the cause of the problem

But I'm not sure whether vscode has special handling for this situation or just forgot to check

redhat-developer/lsp4ij#579
kcl-lang/kcl#1698

Activity

  1. dbaeumer commented on Oct 18, 2024

    @dbaeumer
    Member

    VS Code doesn't currently have checking code for this.

  2. rcjsuen commented on Oct 25, 2024

    @rcjsuen
    Contributor

    I ran into this as well. If VS Code detects this what should it do? 🤔

  3. dbaeumer commented on Oct 28, 2024

    @dbaeumer
    Member

    The only way how we could handle this is IMO by returning it as a Response error and then report it on the other side via an Error.

  4. dbaeumer commented on Dec 12, 2024

    @dbaeumer
    Member

    We should make this a setting since it can have unexpected behaviour.

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

    feature-requestRequest for new features or functionalityhelp wantedIssues identified as good community contribution opportunities

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions