mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-20 00:28:52 +01:00
Fix inlay hint location (#191122)
This commit is contained in:
@@ -77,7 +77,7 @@ class TypeScriptInlayHintsProvider extends Disposable implements vscode.InlayHin
|
||||
return response.body.map(hint => {
|
||||
const result = new vscode.InlayHint(
|
||||
Position.fromLocation(hint.position),
|
||||
this.convertInlayHintText(model.uri, hint),
|
||||
this.convertInlayHintText(hint),
|
||||
hint.kind && fromProtocolInlayHintKind(hint.kind)
|
||||
);
|
||||
result.paddingLeft = hint.whitespaceBefore;
|
||||
@@ -86,19 +86,18 @@ class TypeScriptInlayHintsProvider extends Disposable implements vscode.InlayHin
|
||||
});
|
||||
}
|
||||
|
||||
private convertInlayHintText(resource: vscode.Uri, tsHint: Proto.InlayHintItem): string | vscode.InlayHintLabelPart[] {
|
||||
private convertInlayHintText(tsHint: Proto.InlayHintItem): string | vscode.InlayHintLabelPart[] {
|
||||
if (tsHint.displayParts) {
|
||||
return tsHint.displayParts.map((part): vscode.InlayHintLabelPart => {
|
||||
const out = new vscode.InlayHintLabelPart(part.text);
|
||||
if (part.span) {
|
||||
out.location = Location.fromTextSpan(resource, part.span);
|
||||
out.location = Location.fromTextSpan(this.client.toResource(part.span.file), part.span);
|
||||
}
|
||||
return out;
|
||||
});
|
||||
}
|
||||
|
||||
return tsHint.text;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user