diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/window.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/window.test.ts index 91efbf70974..176d2819dd9 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/window.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/window.test.ts @@ -5,7 +5,7 @@ import * as assert from 'assert'; import { join } from 'path'; -import { CancellationTokenSource, commands, Position, QuickPickItem, Selection, StatusBarAlignment, TextEditor, TextEditorSelectionChangeKind, TextEditorViewColumnChangeEvent, Uri, ViewColumn, window, workspace } from 'vscode'; +import { CancellationTokenSource, commands, MarkdownString, Position, QuickPickItem, Selection, StatusBarAlignment, TextEditor, TextEditorSelectionChangeKind, TextEditorViewColumnChangeEvent, Uri, ViewColumn, window, workspace } from 'vscode'; import { assertNoRpc, closeAllEditors, createRandomFile, pathEquals } from '../utils'; @@ -735,6 +735,10 @@ suite('vscode API - window', () => { assert.strictEqual(statusBarEntryWithoutId.name, undefined); statusBarEntryWithoutId.name = 'Test Name'; assert.strictEqual(statusBarEntryWithoutId.name, 'Test Name'); + statusBarEntryWithoutId.tooltip = 'Tooltip'; + assert.strictEqual(statusBarEntryWithoutId.tooltip, 'Tooltip'); + statusBarEntryWithoutId.tooltip = new MarkdownString('**bold**'); + assert.strictEqual(statusBarEntryWithoutId.tooltip.value, '**bold**'); const statusBarEntryWithId = window.createStatusBarItem('testId', StatusBarAlignment.Right, 200); assert.strictEqual(statusBarEntryWithId.alignment, StatusBarAlignment.Right); diff --git a/src/vs/workbench/api/common/extHostStatusBar.ts b/src/vs/workbench/api/common/extHostStatusBar.ts index 4c4395e8346..b24f5f8612e 100644 --- a/src/vs/workbench/api/common/extHostStatusBar.ts +++ b/src/vs/workbench/api/common/extHostStatusBar.ts @@ -86,6 +86,10 @@ export class ExtHostStatusBarEntry implements vscode.StatusBarItem { return this._name; } + public get tooltip(): vscode.MarkdownString | string | undefined { + return this._tooltip; + } + public get color(): string | ThemeColor | undefined { return this._color; } @@ -112,7 +116,7 @@ export class ExtHostStatusBarEntry implements vscode.StatusBarItem { this.update(); } - public set tooltip(tooltip: string | undefined) { + public set tooltip(tooltip: vscode.MarkdownString | string | undefined) { this._tooltip = tooltip; this.update(); }