File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/vs/editor/contrib/inlineCompletions/browser Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,9 @@ export async function provideInlineCompletions(
27
27
token : CancellationToken = CancellationToken . None ,
28
28
languageConfigurationService ?: ILanguageConfigurationService ,
29
29
) : 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
+
30
33
const providers = registry . all ( model ) ;
31
34
const providerResults = await Promise . all ( providers . map ( async provider => {
32
35
try {
@@ -38,8 +41,6 @@ export async function provideInlineCompletions(
38
41
return ( { provider, completions : undefined } ) ;
39
42
} ) ) ;
40
43
41
- const defaultReplaceRange = getDefaultRange ( position , model ) ;
42
-
43
44
const itemsByHash = new Map < string , InlineCompletionItem > ( ) ;
44
45
const lists : InlineCompletionList [ ] = [ ] ;
45
46
for ( const result of providerResults ) {
You can’t perform that action at this time.
0 commit comments