diff --git a/src/vs/platform/actionWidget/browser/actionWidget.ts b/src/vs/platform/actionWidget/browser/actionWidget.ts index 8fa5405be05..570588b6097 100644 --- a/src/vs/platform/actionWidget/browser/actionWidget.ts +++ b/src/vs/platform/actionWidget/browser/actionWidget.ts @@ -10,9 +10,9 @@ import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; import { Disposable, DisposableStore, IDisposable, MutableDisposable } from 'vs/base/common/lifecycle'; import 'vs/css!./actionWidget'; import { localize } from 'vs/nls'; -import { Action2, registerAction2 } from 'vs/platform/actions/common/actions'; import { acceptSelectedActionCommand, ActionList, IListMenuItem, previewSelectedActionCommand } from 'vs/platform/actionWidget/browser/actionList'; import { IActionItem } from 'vs/platform/actionWidget/common/actionWidget'; +import { Action2, registerAction2 } from 'vs/platform/actions/common/actions'; import { IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; @@ -34,7 +34,7 @@ export const IActionWidgetService = createDecorator('actio export interface IActionWidgetService { readonly _serviceBrand: undefined; - show(user: string, supportsPreview: boolean, items: IListMenuItem[], delegate: IRenderDelegate, anchor: IAnchor, container: HTMLElement | undefined, actionBarActions?: readonly IAction[]): Promise; + show(user: string, supportsPreview: boolean, items: readonly IListMenuItem[], delegate: IRenderDelegate, anchor: IAnchor, container: HTMLElement | undefined, actionBarActions?: readonly IAction[]): void; hide(): void; @@ -51,18 +51,18 @@ class ActionWidgetService extends Disposable implements IActionWidgetService { private readonly _list = this._register(new MutableDisposable>()); constructor( - @IContextViewService private readonly contextViewService: IContextViewService, + @IContextViewService private readonly _contextViewService: IContextViewService, @IContextKeyService private readonly _contextKeyService: IContextKeyService, @IInstantiationService private readonly _instantiationService: IInstantiationService ) { super(); } - async show(user: string, supportsPreview: boolean, items: IListMenuItem[], delegate: IRenderDelegate, anchor: IAnchor, container: HTMLElement | undefined, actionBarActions?: readonly IAction[]): Promise { + show(user: string, supportsPreview: boolean, items: readonly IListMenuItem[], delegate: IRenderDelegate, anchor: IAnchor, container: HTMLElement | undefined, actionBarActions?: readonly IAction[]): void { const visibleContext = ActionWidgetContextKeys.Visible.bindTo(this._contextKeyService); const list = this._instantiationService.createInstance(ActionList, user, supportsPreview, items, delegate); - this.contextViewService.showContextView({ + this._contextViewService.showContextView({ getAnchor: () => anchor, render: (container: HTMLElement) => { visibleContext.set(true); @@ -70,7 +70,7 @@ class ActionWidgetService extends Disposable implements IActionWidgetService { }, onHide: (didCancel) => { visibleContext.reset(); - return this._onWidgetClosed(didCancel); + this._onWidgetClosed(didCancel); }, }, container, false); }