Distinguish context key factory from type

This commit is contained in:
Alex Dima
2020-02-28 13:52:13 +01:00
parent 0cd0f7df41
commit 0c29fa309f
30 changed files with 167 additions and 162 deletions

View File

@@ -15,7 +15,7 @@ import { IModelService } from 'vs/editor/common/services/modelService';
import { ITextModelService } from 'vs/editor/common/services/resolverService';
import { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions';
import { CommandsRegistry, ICommandHandlerDescription } from 'vs/platform/commands/common/commands';
import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { ContextKeyExpr, IContextKeyService, ContextKeyExpression } from 'vs/platform/contextkey/common/contextkey';
import { IConstructorSignature1, ServicesAccessor as InstantiationServicesAccessor, BrandedService } from 'vs/platform/instantiation/common/instantiation';
import { IKeybindings, KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { Registry } from 'vs/platform/registry/common/platform';
@@ -39,26 +39,26 @@ export interface IDiffEditorContributionDescription {
//#region Command
export interface ICommandKeybindingsOptions extends IKeybindings {
kbExpr?: ContextKeyExpr | null;
kbExpr?: ContextKeyExpression | null;
weight: number;
}
export interface ICommandMenuOptions {
menuId: MenuId;
group: string;
order: number;
when?: ContextKeyExpr;
when?: ContextKeyExpression;
title: string;
}
export interface ICommandOptions {
id: string;
precondition: ContextKeyExpr | undefined;
precondition: ContextKeyExpression | undefined;
kbOpts?: ICommandKeybindingsOptions;
description?: ICommandHandlerDescription;
menuOpts?: ICommandMenuOptions | ICommandMenuOptions[];
}
export abstract class Command {
public readonly id: string;
public readonly precondition: ContextKeyExpr | undefined;
public readonly precondition: ContextKeyExpression | undefined;
private readonly _kbOpts: ICommandKeybindingsOptions | undefined;
private readonly _menuOpts: ICommandMenuOptions | ICommandMenuOptions[] | undefined;
private readonly _description: ICommandHandlerDescription | undefined;
@@ -193,7 +193,7 @@ export abstract class EditorCommand extends Command {
export interface IEditorActionContextMenuOptions {
group: string;
order: number;
when?: ContextKeyExpr;
when?: ContextKeyExpression;
menuId?: MenuId;
}
export interface IActionOptions extends ICommandOptions {