add InlayHint#tooltip and wire it up with hover participant, https://github.com/microsoft/vscode/issues/129528

This commit is contained in:
Johannes Rieken
2022-01-06 14:35:44 +01:00
parent 270154ae22
commit 0c933120f6
6 changed files with 23 additions and 5 deletions

View File

@@ -1155,10 +1155,11 @@ export namespace InlayHint {
export function from(hint: vscode.InlayHint): modes.InlayHint {
return {
text: hint.text,
tooltip: hint.tooltip && MarkdownString.from(hint.tooltip),
position: Position.from(hint.position),
kind: InlayHintKind.from(hint.kind ?? types.InlayHintKind.Other),
whitespaceBefore: hint.whitespaceBefore,
whitespaceAfter: hint.whitespaceAfter
whitespaceAfter: hint.whitespaceAfter,
};
}
@@ -1168,6 +1169,7 @@ export namespace InlayHint {
Position.to(hint.position),
InlayHintKind.to(hint.kind)
);
res.tooltip = htmlContent.isMarkdownString(hint.tooltip) ? MarkdownString.to(hint.tooltip) : hint.tooltip;
res.whitespaceAfter = hint.whitespaceAfter;
res.whitespaceBefore = hint.whitespaceBefore;
return res;

View File

@@ -1423,6 +1423,7 @@ export enum InlayHintKind {
@es5ClassCompat
export class InlayHint {
text: string;
tooltip?: string | vscode.MarkdownString;
position: Position;
kind?: vscode.InlayHintKind;
whitespaceBefore?: boolean;