diff --git a/src/vs/editor/contrib/suggest/suggestWidgetStatus.ts b/src/vs/editor/contrib/suggest/suggestWidgetStatus.ts index 08688ba632c52..5bea57e4078ed 100644 --- a/src/vs/editor/contrib/suggest/suggestWidgetStatus.ts +++ b/src/vs/editor/contrib/suggest/suggestWidgetStatus.ts @@ -14,11 +14,22 @@ import { MenuEntryActionViewItem } from 'vs/platform/actions/browser/menuEntryAc import { IMenuService, MenuItemAction } from 'vs/platform/actions/common/actions'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; +import { INotificationService } from 'vs/platform/notification/common/notification'; class StatusBarViewItem extends MenuEntryActionViewItem { + constructor( + action: MenuItemAction, + @IKeybindingService keybindingService: IKeybindingService, + @INotificationService notificationService: INotificationService, + @IContextKeyService private _contextKeyService: IContextKeyService, + ) { + super(action, undefined, keybindingService, notificationService); + } + override updateLabel() { - const kb = this._keybindingService.lookupKeybinding(this._action.id); + const kb = this._keybindingService.lookupKeybinding(this._action.id, this._contextKeyService); if (!kb) { return super.updateLabel(); } @@ -49,7 +60,7 @@ export class SuggestWidgetStatus { this.element = dom.append(container, dom.$('.suggest-status-bar')); const actionViewItemProvider = (action => { - return action instanceof MenuItemAction ? instantiationService.createInstance(StatusBarViewItem, action, undefined) : undefined; + return action instanceof MenuItemAction ? instantiationService.createInstance(StatusBarViewItem, action) : undefined; }); this._leftActions = new ActionBar(this.element, { actionViewItemProvider }); this._rightActions = new ActionBar(this.element, { actionViewItemProvider });