Skip to content

Text edits at the same position are not applied in LSP spec order #1404

@scriptacus

Description

@scriptacus

When multiple text edits have the same position, lsp4ij does not preserve their array order as required by the LSP specification.

LSP Specification:

From the Language Server Protocol specification for CompletionItem.additionalTextEdits:
"If multiple inserts have the same position, the order in the array defines the order in which the inserted strings appear in the resulting text."

Issue:

The TEXT_EDITS_ASCENDING_COMPARATOR in LSPIJUtils.java returns 0 for edits at the same position, resulting in an unstable sort that doesn't preserve the original array order.

lsp4ij version: 0.19.2-SNAPSHOT

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions