mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-18 07:29:16 -05: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:
@@ -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