Skip to content

Commit

Permalink
Fix optionalReplacementSpan not being applied to completion entries (m…
Browse files Browse the repository at this point in the history
…icrosoft#200945)

* Fix optionalReplacementSpan not being applied to completion entries

* Format completions.ts
  • Loading branch information
johnsoncodehk authored Jan 3, 2024
1 parent eb55c74 commit 40c0f93
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,12 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider<
isIncomplete = !!response.body.isIncomplete || (response as any).metadata && (response as any).metadata.isIncomplete;
entries = response.body.entries;
metadata = response.metadata;

if (response.body.optionalReplacementSpan) {
for (const entry of entries) {
entry.replacementSpan ??= response.body.optionalReplacementSpan;
}
}
} else {
const response = await this.client.interruptGetErr(() => this.client.execute('completions', args, token));
if (response.type !== 'response' || !response.body) {
Expand Down

0 comments on commit 40c0f93

Please sign in to comment.