Allow using Command in StatusBarItem (#92046)

Fixes #22353

StatusBarItem is one of the few places in our API where we only allow extensions to give us a command as a `string` instead of as `Command` object. This change updates the API to also allow passing in a `vscode.Command` (which also allows arguments!)
This commit is contained in:
Matt Bierner
2020-03-09 12:57:33 -07:00
committed by GitHub
parent 0b3e54edb1
commit 44d4fe895d
8 changed files with 59 additions and 33 deletions

View File

@@ -8,6 +8,7 @@ import { MainThreadStatusBarShape, MainContext, IExtHostContext } from '../commo
import { ThemeColor } from 'vs/platform/theme/common/themeService';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { dispose } from 'vs/base/common/lifecycle';
import { Command } from 'vs/editor/common/modes';
@extHostNamedCustomer(MainContext.MainThreadStatusBar)
export class MainThreadStatusBar implements MainThreadStatusBarShape {
@@ -24,7 +25,7 @@ export class MainThreadStatusBar implements MainThreadStatusBarShape {
this.entries.clear();
}
$setEntry(id: number, statusId: string, statusName: string, text: string, tooltip: string | undefined, command: string | undefined, color: string | ThemeColor | undefined, alignment: MainThreadStatusBarAlignment, priority: number | undefined): void {
$setEntry(id: number, statusId: string, statusName: string, text: string, tooltip: string | undefined, command: Command | undefined, color: string | ThemeColor | undefined, alignment: MainThreadStatusBarAlignment, priority: number | undefined): void {
const entry: IStatusbarEntry = { text, tooltip, command, color };
if (typeof priority === 'undefined') {