eclipse-lsp4j / lsp4j

A Java implementation of the language server protocol intended to be consumed by tools and language servers implemented in Java.

Home Page:https://eclipse.org/lsp4j

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Completion Request does not support contextSupport

ghentschke opened this issue · comments

The current implementation for a LS client does not support the contextSupport option in the LSP.

This results in a textDocument/completion request that looks like this:

V[14:31:48.100] <<< {
  "id": "15",
  "jsonrpc": "2.0",
  "method": "textDocument/completion",
  "params": {
    "position": {
      "character": 7,
      "line": 41
    },
    "textDocument": {
      "uri": "file:///C:/TR/workspaces/runtime-cdt-development/Cmk1/Cmk1.cpp"
    }
  }
}

Whereas this call in the vscode client looks like this:

V[11:17:37.940] <<< {
  "id": 17,
  "jsonrpc": "2.0",
  "method": "textDocument/completion",
  "params": {
    "context": {
      "triggerCharacter": ":",
      "triggerKind": 2
    },
    "position": {
      "character": 7,
      "line": 66
    },
    "textDocument": {
      "uri": "file:///c%3A/git_llvm/llvm-project/clang-tools-extra/clangd/test.hpp"
    }
  }
}

Due to the missing context, the list of possible completions contains invalid suggestions. See also this cdt-lsp #154 issue.

Sorry, I've seen that LSP4J support it, but LSP4E does not.