mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
Fix optionalReplacementSpan not being applied to completion entries (#200945)
* Fix optionalReplacementSpan not being applied to completion entries * Format completions.ts
This commit is contained in:
parent
eb55c74a90
commit
40c0f939e5
|
@ -760,6 +760,12 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider<
|
||||||
isIncomplete = !!response.body.isIncomplete || (response as any).metadata && (response as any).metadata.isIncomplete;
|
isIncomplete = !!response.body.isIncomplete || (response as any).metadata && (response as any).metadata.isIncomplete;
|
||||||
entries = response.body.entries;
|
entries = response.body.entries;
|
||||||
metadata = response.metadata;
|
metadata = response.metadata;
|
||||||
|
|
||||||
|
if (response.body.optionalReplacementSpan) {
|
||||||
|
for (const entry of entries) {
|
||||||
|
entry.replacementSpan ??= response.body.optionalReplacementSpan;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
const response = await this.client.interruptGetErr(() => this.client.execute('completions', args, token));
|
const response = await this.client.interruptGetErr(() => this.client.execute('completions', args, token));
|
||||||
if (response.type !== 'response' || !response.body) {
|
if (response.type !== 'response' || !response.body) {
|
||||||
|
|
Loading…
Reference in a new issue