Skip to content

LSP: Support for additionalTextEdits in CompletionItem #3842

@AJenbo

Description

@AJenbo

Describe your idea in details

Currently when completions are returned from the server CodeLite doesn't take into account that there can be additionalTextEdits that are part of the CompletionItem. The can bee seen in the spec.

Steps to reproduce

Trigger a completion that holds additionalTextEdits. For example, here is one from Metals:

{
  "isIncomplete": false,
  "items": [
    {
      "label": "test",
      "kind": 12,
      "detail": ": String",
      "preselect": true,
      "sortText": "00000",
      "filterText": "\"$test ",
      "insertTextFormat": 1,
      "textEdit": {
        "range": {
          "start": {
            "line": 26,
            "character": 12
          },
          "end": {
            "line": 26,
            "character": 16
          }
        },
        "newText": "test"
      },
      "additionalTextEdits": [
        {
          "range": {
            "start": {
              "line": 26,
              "character": 10
            },
            "end": {
              "line": 26,
              "character": 10
            }
          },
          "newText": "s"
        }
      ],
      "data": {
        "symbol": "example/Hello.test.",
        "target": "file:/Users/ckipp/Documents/scala-workspace/metals-minimal-sbt/?id\u003droot"
      }
    }
  ]
}

Currently the textEdit is applied, but the additionalTextEdits are not.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions