mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Fix hover tooltips (#14561)
This commit is contained in:
@@ -274,8 +274,8 @@ export namespace MarkdownString {
|
||||
if (isCodeblock(markup)) {
|
||||
const { language, value } = markup;
|
||||
res = { value: '```' + language + '\n' + value + '\n```\n' };
|
||||
} else if (htmlContent.isMarkdownString(markup)) {
|
||||
res = markup;
|
||||
} else if (types.MarkdownString.isMarkdownString(markup)) {
|
||||
res = { value: markup.value, isTrusted: markup.isTrusted, supportThemeIcons: markup.supportThemeIcons };
|
||||
} else if (typeof markup === 'string') {
|
||||
res = { value: markup };
|
||||
} else {
|
||||
@@ -343,7 +343,7 @@ export namespace MarkdownString {
|
||||
return result;
|
||||
}
|
||||
|
||||
export function fromStrict(value: string | types.MarkdownString): undefined | string | htmlContent.IMarkdownString {
|
||||
export function fromStrict(value: string | vscode.MarkdownString): undefined | string | htmlContent.IMarkdownString {
|
||||
if (!value) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -1276,7 +1276,9 @@ export class CodeLens {
|
||||
}
|
||||
|
||||
@es5ClassCompat
|
||||
export class MarkdownString extends BaseMarkdownString implements vscode.MarkdownString {
|
||||
export class MarkdownString implements vscode.MarkdownString {
|
||||
|
||||
readonly #delegate: BaseMarkdownString;
|
||||
|
||||
static isMarkdownString(thing: any): thing is vscode.MarkdownString {
|
||||
if (thing instanceof MarkdownString) {
|
||||
@@ -1286,18 +1288,53 @@ export class MarkdownString extends BaseMarkdownString implements vscode.Markdow
|
||||
}
|
||||
|
||||
constructor(value?: string, supportThemeIcons: boolean = false) {
|
||||
super(value ?? '', { supportThemeIcons });
|
||||
this.#delegate = new BaseMarkdownString(value, { supportThemeIcons });
|
||||
}
|
||||
|
||||
get value(): string {
|
||||
return this.#delegate.value;
|
||||
}
|
||||
set value(value: string) {
|
||||
this.#delegate.value = value;
|
||||
}
|
||||
|
||||
get isTrusted(): boolean | undefined {
|
||||
return this.#delegate.isTrusted;
|
||||
}
|
||||
|
||||
set isTrusted(value: boolean | undefined) {
|
||||
this.#delegate.isTrusted = value;
|
||||
}
|
||||
|
||||
get supportThemeIcons(): boolean | undefined {
|
||||
return this.#delegate.supportThemeIcons;
|
||||
}
|
||||
|
||||
appendText(value: string): vscode.MarkdownString {
|
||||
this.#delegate.appendText(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
appendMarkdown(value: string): vscode.MarkdownString {
|
||||
this.#delegate.appendMarkdown(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
appendCodeblock(value: string, language?: string): vscode.MarkdownString {
|
||||
this.#delegate.appendCodeblock(language ?? '', value);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@es5ClassCompat
|
||||
export class ParameterInformation {
|
||||
|
||||
label: string | [number, number];
|
||||
documentation?: string | MarkdownString;
|
||||
documentation?: string | vscode.MarkdownString;
|
||||
|
||||
constructor(label: string | [number, number], documentation?: string | MarkdownString) {
|
||||
constructor(label: string | [number, number], documentation?: string | vscode.MarkdownString) {
|
||||
this.label = label;
|
||||
this.documentation = documentation;
|
||||
}
|
||||
@@ -1307,11 +1344,11 @@ export class ParameterInformation {
|
||||
export class SignatureInformation {
|
||||
|
||||
label: string;
|
||||
documentation?: string | MarkdownString;
|
||||
documentation?: string | vscode.MarkdownString;
|
||||
parameters: ParameterInformation[];
|
||||
activeParameter?: number;
|
||||
|
||||
constructor(label: string, documentation?: string | MarkdownString) {
|
||||
constructor(label: string, documentation?: string | vscode.MarkdownString) {
|
||||
this.label = label;
|
||||
this.documentation = documentation;
|
||||
this.parameters = [];
|
||||
@@ -1397,7 +1434,7 @@ export class CompletionItem implements vscode.CompletionItem {
|
||||
kind?: CompletionItemKind;
|
||||
tags?: CompletionItemTag[];
|
||||
detail?: string;
|
||||
documentation?: string | MarkdownString;
|
||||
documentation?: string | vscode.MarkdownString;
|
||||
sortText?: string;
|
||||
filterText?: string;
|
||||
preselect?: boolean;
|
||||
|
||||
Reference in New Issue
Block a user