mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 18:49:00 +01:00
support label part tooltip in addition to item tooltip, https://github.com/microsoft/vscode/issues/16221#issuecomment-264527520
This commit is contained in:
@@ -1268,13 +1268,14 @@ class InlayHintsAdapter {
|
||||
result.label = hint.label;
|
||||
} else {
|
||||
result.label = hint.label.map(part => {
|
||||
let r: modes.InlayHintLabelPart = { label: part.label };
|
||||
let result: modes.InlayHintLabelPart = { label: part.label };
|
||||
result.tooltip = part.tooltip && typeConvert.MarkdownString.from(part.tooltip);
|
||||
if (Location.isLocation(part.location)) {
|
||||
r.location = typeConvert.location.from(part.location);
|
||||
result.location = typeConvert.location.from(part.location);
|
||||
} else if (part.command) {
|
||||
r.command = this._commands.toInternal(part.command, disposables);
|
||||
result.command = this._commands.toInternal(part.command, disposables);
|
||||
}
|
||||
return r;
|
||||
return result;
|
||||
});
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -1169,7 +1169,9 @@ export namespace InlayHintLabelPart {
|
||||
|
||||
export function to(converter: CommandsConverter, part: modes.InlayHintLabelPart): types.InlayHintLabelPart {
|
||||
const result = new types.InlayHintLabelPart(part.label);
|
||||
|
||||
result.tooltip = htmlContent.isMarkdownString(part.tooltip)
|
||||
? MarkdownString.to(part.tooltip)
|
||||
: part.tooltip;
|
||||
if (modes.Command.is(part.command)) {
|
||||
result.command = converter.fromInternal(part.command);
|
||||
} else if (part.location) {
|
||||
|
||||
@@ -1423,7 +1423,9 @@ export enum InlayHintKind {
|
||||
|
||||
@es5ClassCompat
|
||||
export class InlayHintLabelPart {
|
||||
|
||||
label: string;
|
||||
tooltip?: string | vscode.MarkdownString;
|
||||
location?: Location;
|
||||
command?: vscode.Command;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user