-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix completion entry conversion to protocol format (#59410)
- Loading branch information
Showing
13 changed files
with
881 additions
and
279 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
66 changes: 66 additions & 0 deletions
66
tests/baselines/reference/completionsServerCommitCharacters.baseline
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,66 @@ | ||
// === Completions === | ||
=== /src/index.ts === | ||
// const a: "aa" | "bb" = ""; | ||
// ^ | ||
// | ---------------------------------------------------------------------- | ||
// | aa | ||
// | bb | ||
// | ---------------------------------------------------------------------- | ||
|
||
[ | ||
{ | ||
"marker": { | ||
"fileName": "/src/index.ts", | ||
"position": 24, | ||
"name": "" | ||
}, | ||
"item": { | ||
"isGlobalCompletion": false, | ||
"isMemberCompletion": false, | ||
"isNewIdentifierLocation": false, | ||
"entries": [ | ||
{ | ||
"name": "aa", | ||
"kind": "string", | ||
"kindModifiers": "", | ||
"sortText": "11", | ||
"replacementSpan": { | ||
"start": 24, | ||
"length": 0 | ||
}, | ||
"commitCharacters": [], | ||
"displayParts": [ | ||
{ | ||
"text": "aa", | ||
"kind": "text" | ||
} | ||
], | ||
"tags": [] | ||
}, | ||
{ | ||
"name": "bb", | ||
"kind": "string", | ||
"kindModifiers": "", | ||
"sortText": "11", | ||
"replacementSpan": { | ||
"start": 24, | ||
"length": 0 | ||
}, | ||
"commitCharacters": [], | ||
"displayParts": [ | ||
{ | ||
"text": "bb", | ||
"kind": "text" | ||
} | ||
], | ||
"tags": [] | ||
} | ||
], | ||
"defaultCommitCharacters": [ | ||
".", | ||
",", | ||
";" | ||
] | ||
} | ||
} | ||
] |
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
249 changes: 249 additions & 0 deletions
249
tests/baselines/reference/tsserver/fourslashServer/completionsServerCommitCharacters.js
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,249 @@ | ||
currentDirectory:: / useCaseSensitiveFileNames: false | ||
Info seq [hh:mm:ss:mss] Provided types map file "/typesMap.json" doesn't exist | ||
//// [/lib.d.ts] | ||
lib.d.ts-Text | ||
|
||
//// [/lib.decorators.d.ts] | ||
lib.decorators.d.ts-Text | ||
|
||
//// [/lib.decorators.legacy.d.ts] | ||
lib.decorators.legacy.d.ts-Text | ||
|
||
//// [/src/index.ts] | ||
const a: "aa" | "bb" = ""; | ||
|
||
|
||
Info seq [hh:mm:ss:mss] request: | ||
{ | ||
"seq": 0, | ||
"type": "request", | ||
"arguments": { | ||
"file": "/src/index.ts" | ||
}, | ||
"command": "open" | ||
} | ||
Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /src/index.ts ProjectRootPath: undefined:: Result: undefined | ||
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1* | ||
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /lib.d.ts 500 undefined WatchType: Closed Script info | ||
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /lib.decorators.d.ts 500 undefined WatchType: Closed Script info | ||
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info | ||
Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms | ||
Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) | ||
Info seq [hh:mm:ss:mss] Files (4) | ||
/lib.d.ts Text-1 lib.d.ts-Text | ||
/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text | ||
/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text | ||
/src/index.ts SVC-1-0 "const a: \"aa\" | \"bb\" = \"\";" | ||
|
||
|
||
../lib.d.ts | ||
Default library for target 'es5' | ||
../lib.decorators.d.ts | ||
Library referenced via 'decorators' from file '../lib.d.ts' | ||
../lib.decorators.legacy.d.ts | ||
Library referenced via 'decorators.legacy' from file '../lib.d.ts' | ||
index.ts | ||
Root file specified for compilation | ||
|
||
Info seq [hh:mm:ss:mss] ----------------------------------------------- | ||
Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) | ||
Info seq [hh:mm:ss:mss] Files (4) | ||
|
||
Info seq [hh:mm:ss:mss] ----------------------------------------------- | ||
Info seq [hh:mm:ss:mss] Open files: | ||
Info seq [hh:mm:ss:mss] FileName: /src/index.ts ProjectRootPath: undefined | ||
Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* | ||
Info seq [hh:mm:ss:mss] response: | ||
{ | ||
"seq": 0, | ||
"type": "response", | ||
"command": "open", | ||
"request_seq": 0, | ||
"success": true, | ||
"performanceData": { | ||
"updateGraphDurationMs": * | ||
} | ||
} | ||
After Request | ||
watchedFiles:: | ||
/lib.d.ts: *new* | ||
{"pollingInterval":500} | ||
/lib.decorators.d.ts: *new* | ||
{"pollingInterval":500} | ||
/lib.decorators.legacy.d.ts: *new* | ||
{"pollingInterval":500} | ||
|
||
Projects:: | ||
/dev/null/inferredProject1* (Inferred) *new* | ||
projectStateVersion: 1 | ||
projectProgramVersion: 1 | ||
|
||
ScriptInfos:: | ||
/lib.d.ts *new* | ||
version: Text-1 | ||
containingProjects: 1 | ||
/dev/null/inferredProject1* | ||
/lib.decorators.d.ts *new* | ||
version: Text-1 | ||
containingProjects: 1 | ||
/dev/null/inferredProject1* | ||
/lib.decorators.legacy.d.ts *new* | ||
version: Text-1 | ||
containingProjects: 1 | ||
/dev/null/inferredProject1* | ||
/src/index.ts (Open) *new* | ||
version: SVC-1-0 | ||
containingProjects: 1 | ||
/dev/null/inferredProject1* *default* | ||
|
||
Info seq [hh:mm:ss:mss] request: | ||
{ | ||
"seq": 1, | ||
"type": "request", | ||
"arguments": { | ||
"file": "/src/index.ts", | ||
"line": 1, | ||
"offset": 25 | ||
}, | ||
"command": "completionInfo" | ||
} | ||
Info seq [hh:mm:ss:mss] response: | ||
{ | ||
"seq": 0, | ||
"type": "response", | ||
"command": "completionInfo", | ||
"request_seq": 1, | ||
"success": true, | ||
"body": { | ||
"isGlobalCompletion": false, | ||
"isMemberCompletion": false, | ||
"isNewIdentifierLocation": false, | ||
"optionalReplacementSpan": { | ||
"start": { | ||
"line": 1, | ||
"offset": 25 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"offset": 25 | ||
} | ||
}, | ||
"entries": [ | ||
{ | ||
"name": "aa", | ||
"kind": "string", | ||
"kindModifiers": "", | ||
"sortText": "11", | ||
"replacementSpan": { | ||
"start": { | ||
"line": 1, | ||
"offset": 25 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"offset": 25 | ||
} | ||
}, | ||
"commitCharacters": [] | ||
}, | ||
{ | ||
"name": "bb", | ||
"kind": "string", | ||
"kindModifiers": "", | ||
"sortText": "11", | ||
"replacementSpan": { | ||
"start": { | ||
"line": 1, | ||
"offset": 25 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"offset": 25 | ||
} | ||
}, | ||
"commitCharacters": [] | ||
} | ||
], | ||
"defaultCommitCharacters": [ | ||
".", | ||
",", | ||
";" | ||
] | ||
} | ||
} | ||
Info seq [hh:mm:ss:mss] request: | ||
{ | ||
"seq": 2, | ||
"type": "request", | ||
"arguments": { | ||
"file": "/src/index.ts", | ||
"line": 1, | ||
"offset": 25, | ||
"entryNames": [ | ||
{ | ||
"name": "aa" | ||
} | ||
] | ||
}, | ||
"command": "completionEntryDetails-full" | ||
} | ||
Info seq [hh:mm:ss:mss] response: | ||
{ | ||
"seq": 0, | ||
"type": "response", | ||
"command": "completionEntryDetails-full", | ||
"request_seq": 2, | ||
"success": true, | ||
"body": [ | ||
{ | ||
"name": "aa", | ||
"kindModifiers": "", | ||
"kind": "string", | ||
"displayParts": [ | ||
{ | ||
"text": "aa", | ||
"kind": "text" | ||
} | ||
], | ||
"tags": [] | ||
} | ||
] | ||
} | ||
Info seq [hh:mm:ss:mss] request: | ||
{ | ||
"seq": 3, | ||
"type": "request", | ||
"arguments": { | ||
"file": "/src/index.ts", | ||
"line": 1, | ||
"offset": 25, | ||
"entryNames": [ | ||
{ | ||
"name": "bb" | ||
} | ||
] | ||
}, | ||
"command": "completionEntryDetails-full" | ||
} | ||
Info seq [hh:mm:ss:mss] response: | ||
{ | ||
"seq": 0, | ||
"type": "response", | ||
"command": "completionEntryDetails-full", | ||
"request_seq": 3, | ||
"success": true, | ||
"body": [ | ||
{ | ||
"name": "bb", | ||
"kindModifiers": "", | ||
"kind": "string", | ||
"displayParts": [ | ||
{ | ||
"text": "bb", | ||
"kind": "text" | ||
} | ||
], | ||
"tags": [] | ||
} | ||
] | ||
} |
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
Oops, something went wrong.