Open milahu opened 1 year ago
on closer look, the textEdit
range is wrong
actual: range of pkgs.
in line 4
}; in pkgs.
01234567890
{
"range": {
"end": {
"character": 10,
"line": 4
},
"start": {
"character": 6,
"line": 4
}
}
}
expected: start == end == 4:11
{
"range": {
"end": {
"character": 11,
"line": 4
},
"start": {
"character": 11,
"line": 4
}
}
}
spec: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textEdit
interface TextEdit {
/**
* The range of the text document to be manipulated. To insert
* text into a document create a range where start === end.
*/
range: Range;
/**
* The string to be inserted. For delete operations use an
* empty string.
*/
newText: string;
}
to compare, this works: completion from prefix
Describe the bug
vscode says "no suggestions"
autocomplete works for javascript files, so i blame rnix-lsp
Steps to reproduce
edit this nix file
response from rnix-lsp looks ok
jsonrpc: request + response
```json { "jsonrpc": "2.0", "id": 4, "method": "textDocument/completion", "params": { "textDocument": { "uri": "file:///tmp/test-lsp.nix" }, "position": { "line": 4, "character": 11 }, "context": { "triggerKind": 1 } } } ``` ```json { "jsonrpc": "2.0", "id": 4, "result": [ { "deprecated": false, "detail": "Attribute", "label": "hello", "textEdit": { "newText": "hello", "range": { "end": { "character": 10, "line": 4 }, "start": { "character": 6, "line": 4 } } } }, { "deprecated": false, "detail": "Attribute", "label": "a", "textEdit": { "newText": "a", "range": { "end": { "character": 10, "line": 4 }, "start": { "character": 6, "line": 4 } } } } ] } ```jsonrpc traffic was captured with
rnix-lsp-wrapper.sh
```sh #! /bin/sh # rnix-lsp-wrapper.sh cd "$(dirname "$0")" tee -a rnix-lsp.in.txt | ./rnix-lsp | tee -a rnix-lsp.out.txt ```Expected behavior
show suggestions
Additional context
vscodium
Editor configuration