Skip to content

Commit 5f20cf6

Browse files
authored
1 parent e3018c3 commit 5f20cf6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/vs/editor/contrib/inlineCompletions/browser/provideInlineCompletions.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ export async function provideInlineCompletions(
2727
token: CancellationToken = CancellationToken.None,
2828
languageConfigurationService?: ILanguageConfigurationService,
2929
): Promise<InlineCompletionProviderResult> {
30+
// Important: Don't use position after the await calls, as the model could have been changed in the meantime!
31+
const defaultReplaceRange = getDefaultRange(position, model);
32+
3033
const providers = registry.all(model);
3134
const providerResults = await Promise.all(providers.map(async provider => {
3235
try {
@@ -38,8 +41,6 @@ export async function provideInlineCompletions(
3841
return ({ provider, completions: undefined });
3942
}));
4043

41-
const defaultReplaceRange = getDefaultRange(position, model);
42-
4344
const itemsByHash = new Map<string, InlineCompletionItem>();
4445
const lists: InlineCompletionList[] = [];
4546
for (const result of providerResults) {

0 commit comments

Comments
 (0)