mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
Add optionalReplacementSpan to completions response (#40347)
* Add optionalReplacementRange to completions response * Get the name right * Fix unit tests * Fix comment typo * Fix comment typo * Baseline
This commit is contained in:
1 parent
8384018e68
commit
f6f2d36ee3
13 files changed
+76
-5
No files matched your search
@@ -2256,6 +2256,12 @@ namespace ts.server.protocol {
|
||||
readonly isGlobalCompletion: boolean;
|
||||
readonly isMemberCompletion: boolean;
|
||||
readonly isNewIdentifierLocation: boolean;
|
||||
/**
|
||||
* In the absence of `CompletionEntry["replacementSpan"]`, the editor may choose whether to use
|
||||
* this span or its default one. If `CompletionEntry["replacementSpan"]` is defined, that span
|
||||
* must be used to commit that completion entry.
|
||||
*/
|
||||
readonly optionalReplacementSpan?: TextSpan;
|
||||
readonly entries: readonly CompletionEntry[];
|
||||
}
|
||||
|
||||
|
||||
@@ -1783,6 +1783,7 @@ namespace ts.server {
|
||||
|
||||
const res: protocol.CompletionInfo = {
|
||||
...completions,
|
||||
optionalReplacementSpan: completions.optionalReplacementSpan && toProtocolTextSpan(completions.optionalReplacementSpan, scriptInfo),
|
||||
entries,
|
||||
};
|
||||
return res;
|
||||
|
||||
Reference in new issue
Block a user