From 847a6d8cd06970bcadbb0b608e0c27e41a76dd36 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Thu, 22 Jul 2021 17:52:59 -0700 Subject: [PATCH] Fix request position of the inlay hints Fixes #129134 The document may change between the request and when `ensureConfigurationForDocument` completes I think this should fix the shifting around --- .../src/languageFeatures/inlayHints.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/typescript-language-features/src/languageFeatures/inlayHints.ts b/extensions/typescript-language-features/src/languageFeatures/inlayHints.ts index 5ca34a41aad48..7ccc4b2e0072b 100644 --- a/extensions/typescript-language-features/src/languageFeatures/inlayHints.ts +++ b/extensions/typescript-language-features/src/languageFeatures/inlayHints.ts @@ -117,11 +117,11 @@ class TypeScriptInlayHintsProvider extends Disposable implements vscode.InlayHin return []; } - await this.fileConfigurationManager.ensureConfigurationForDocument(model, token); - const start = model.offsetAt(range.start); const length = model.offsetAt(range.end) - start; + await this.fileConfigurationManager.ensureConfigurationForDocument(model, token); + const response = await (this.client as ExperimentalProto.IExtendedTypeScriptServiceClient).execute('provideInlayHints', { file: filepath, start, length }, token); if (response.type !== 'response' || !response.success || !response.body) { return [];