Skip to content

Commit b6a40fd

Browse files
author
Benjamin Pasero
committed
web - remove deprecated command property for home indicator
1 parent 3db1eb5 commit b6a40fd

3 files changed

Lines changed: 6 additions & 35 deletions

File tree

src/vs/workbench/browser/parts/activitybar/activitybarActions.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/bro
2626
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
2727
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
2828
import { createAndFillInActionBarActions } from 'vs/platform/actions/browser/menuEntryActionViewItem';
29-
import { ICommandService } from 'vs/platform/commands/common/commands';
3029
import { Codicon } from 'vs/base/common/codicons';
3130
import { ActionViewItem, Separator } from 'vs/base/browser/ui/actionbar/actionbar';
3231
import { isMacintosh } from 'vs/base/common/platform';
@@ -370,25 +369,6 @@ export class HomeActionViewItem extends ActionViewItem {
370369
}
371370
}
372371

373-
/**
374-
* @deprecated TODO@ben remove me eventually
375-
*/
376-
export class DeprecatedHomeAction extends Action {
377-
378-
constructor(
379-
private readonly command: string,
380-
name: string,
381-
icon: Codicon,
382-
@ICommandService private readonly commandService: ICommandService
383-
) {
384-
super('workbench.action.home', name, icon.classNames);
385-
}
386-
387-
async run(): Promise<void> {
388-
this.commandService.executeCommand(this.command);
389-
}
390-
}
391-
392372
registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {
393373
const activityBarBackgroundColor = theme.getColor(ACTIVITY_BAR_BACKGROUND);
394374
if (activityBarBackgroundColor) {

src/vs/workbench/browser/parts/activitybar/activitybarPart.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import * as nls from 'vs/nls';
88
import { ActionsOrientation, ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
99
import { GLOBAL_ACTIVITY_ID, IActivity, ACCOUNTS_ACTIIVTY_ID } from 'vs/workbench/common/activity';
1010
import { Part } from 'vs/workbench/browser/part';
11-
import { GlobalActivityActionViewItem, ViewContainerActivityAction, PlaceHolderToggleCompositePinnedAction, PlaceHolderViewContainerActivityAction, AccountsActionViewItem, HomeAction, HomeActionViewItem, DeprecatedHomeAction } from 'vs/workbench/browser/parts/activitybar/activitybarActions';
11+
import { GlobalActivityActionViewItem, ViewContainerActivityAction, PlaceHolderToggleCompositePinnedAction, PlaceHolderViewContainerActivityAction, AccountsActionViewItem, HomeAction, HomeActionViewItem } from 'vs/workbench/browser/parts/activitybar/activitybarActions';
1212
import { IBadge, NumberBadge } from 'vs/workbench/services/activity/common/activity';
1313
import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService';
1414
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
@@ -400,7 +400,8 @@ export class ActivitybarPart extends Part implements IActivityBarService {
400400
console.warn(`Unknown home indicator icon ${homeIndicator.icon}`);
401401
codicon = Codicon.code;
402402
}
403-
this.createHomeBar(homeIndicator.href, homeIndicator.command, homeIndicator.title, codicon);
403+
404+
this.createHomeBar(homeIndicator.href, homeIndicator.title, codicon);
404405
this.onDidChangeHomeBarVisibility();
405406
}
406407

@@ -422,7 +423,7 @@ export class ActivitybarPart extends Part implements IActivityBarService {
422423
return this.content;
423424
}
424425

425-
private createHomeBar(href: string, command: string | undefined, title: string, icon: Codicon): void {
426+
private createHomeBar(href: string, title: string, icon: Codicon): void {
426427
this.homeBarContainer = document.createElement('div');
427428
this.homeBarContainer.setAttribute('aria-label', nls.localize('homeIndicator', "Home"));
428429
this.homeBarContainer.setAttribute('role', 'toolbar');
@@ -432,19 +433,14 @@ export class ActivitybarPart extends Part implements IActivityBarService {
432433
orientation: ActionsOrientation.VERTICAL,
433434
animated: false,
434435
ariaLabel: nls.localize('home', "Home"),
435-
actionViewItemProvider: command ? undefined : action => new HomeActionViewItem(action),
436+
actionViewItemProvider: action => new HomeActionViewItem(action),
436437
allowContextMenu: true
437438
}));
438439

439440
const homeBarIconBadge = document.createElement('div');
440441
addClass(homeBarIconBadge, 'home-bar-icon-badge');
441442
this.homeBarContainer.appendChild(homeBarIconBadge);
442-
443-
if (command) {
444-
this.homeBar.push(this._register(this.instantiationService.createInstance(DeprecatedHomeAction, command, title, icon)), { icon: true, label: false });
445-
} else {
446-
this.homeBar.push(this._register(this.instantiationService.createInstance(HomeAction, href, title, icon)));
447-
}
443+
this.homeBar.push(this._register(this.instantiationService.createInstance(HomeAction, href, title, icon)));
448444

449445
const content = assertIsDefined(this.content);
450446
content.prepend(this.homeBarContainer);

src/vs/workbench/workbench.web.api.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,6 @@ interface IHomeIndicator {
106106
*/
107107
href: string;
108108

109-
/**
110-
* @deprecated use `href` instead.
111-
*/
112-
command?: string;
113-
114109
/**
115110
* The icon name for the home indicator. This needs to be one of the existing
116111
* icons from our Codicon icon set. For example `sync`.

0 commit comments

Comments
 (0)