Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(lsp): ensure insert_text is passed back on completions
- Loading branch information
Showing
6 changed files
with
165 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
interface DenoCompilerOptions { | ||
// | ||
} | ||
|
||
interface DenoPermissions { | ||
/** Allow all permissions. */ | ||
all?: boolean; | ||
/** Allow environment access. */ | ||
env?: boolean; | ||
/** Allow high resolution time measurement. */ | ||
hrtime?: boolean; | ||
/** Allow network access. If an array of strings, only those hosts specified | ||
* will be allowed access to | ||
*/ | ||
net?: boolean | string[]; | ||
plugin?: boolean; | ||
read?: boolean | string[]; | ||
write?: boolean | string[]; | ||
} | ||
|
||
interface DenoSettings { | ||
cachedOnly?: boolean; | ||
cert?: string; | ||
noCheck?: boolean; | ||
noRemote?: boolean; | ||
location?: string; | ||
lock?: string; | ||
logLevel?: "debug" | "info"; | ||
quiet?: boolean; | ||
tsconfig?: string; | ||
unstable?: boolean; | ||
v8Flags?: string[]; | ||
watch?: boolean; | ||
} | ||
|
||
interface DenoInspector { | ||
host?: string; | ||
port?: number; | ||
breakOnStart?: boolean; | ||
} | ||
|
||
interface DenoConfiguration { | ||
allow?: DenoPermissions; | ||
compilerOptions?: DenoCompilerOptions; | ||
imports?: Record<string, string>; | ||
inspector?: boolean | DenoInspector; | ||
root?: string; | ||
scopes?: Record<string, Record<string, string>>; | ||
settings?: DenoSettings; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 2, | ||
"method": "textDocument/completion", | ||
"params": { | ||
"textDocument": { | ||
"uri": "file:///a/file.ts" | ||
}, | ||
"position": { | ||
"line": 8, | ||
"character": 4 | ||
}, | ||
"context": { | ||
"triggerKind": 2, | ||
"triggerCharacter": "." | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 4, | ||
"method": "completionItem/resolve", | ||
"params": { | ||
"label": "b?", | ||
"kind": 5, | ||
"sortText": "1", | ||
"filterText": "b", | ||
"insertText": "b", | ||
"data": { | ||
"tsc": { | ||
"specifier": "file:///a/file.ts", | ||
"position": 79, | ||
"name": "b", | ||
"useCodeSnippet": false | ||
} | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
cli/tests/lsp/did_open_notification_completion_optional.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"jsonrpc": "2.0", | ||
"method": "textDocument/didOpen", | ||
"params": { | ||
"textDocument": { | ||
"uri": "file:///a/file.ts", | ||
"languageId": "typescript", | ||
"version": 1, | ||
"text": "interface A {\n b?: string;\n}\n\nconst o: A = {};\n\nfunction c(s: string) {}\n\nc(o.)" | ||
} | ||
} | ||
} |