Skip to content

Commit

Permalink
Fix request position of the inlay hints
Browse files Browse the repository at this point in the history
Fixes microsoft#129134

The document may change between the request and when `ensureConfigurationForDocument` completes

I think this should fix the shifting around
  • Loading branch information
mjbvz committed Jul 23, 2021
1 parent 50ac52c commit 847a6d8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 [];
Expand Down

0 comments on commit 847a6d8

Please sign in to comment.