提交 c43b4376 编写于 作者: T Thomas Ladd

Make context parameter optional for IStandaloneDiffEditor and IStandaloneCodeEditor addCommand

Fix #67011
上级 946e3e23
......@@ -122,13 +122,13 @@ export interface IDiffEditorConstructionOptions extends IDiffEditorOptions {
}
export interface IStandaloneCodeEditor extends ICodeEditor {
addCommand(keybinding: number, handler: ICommandHandler, context: string): string | null;
addCommand(keybinding: number, handler: ICommandHandler, context?: string): string | null;
createContextKey<T>(key: string, defaultValue: T): IContextKey<T>;
addAction(descriptor: IActionDescriptor): IDisposable;
}
export interface IStandaloneDiffEditor extends IDiffEditor {
addCommand(keybinding: number, handler: ICommandHandler, context: string): string | null;
addCommand(keybinding: number, handler: ICommandHandler, context?: string): string | null;
createContextKey<T>(key: string, defaultValue: T): IContextKey<T>;
addAction(descriptor: IActionDescriptor): IDisposable;
......@@ -182,7 +182,7 @@ export class StandaloneCodeEditor extends CodeEditorWidget implements IStandalon
createAriaDomNode();
}
public addCommand(keybinding: number, handler: ICommandHandler, context: string): string | null {
public addCommand(keybinding: number, handler: ICommandHandler, context?: string): string | null {
if (!this._standaloneKeybindingService) {
console.warn('Cannot add command because the editor is configured with an unrecognized KeybindingService');
return null;
......@@ -409,7 +409,7 @@ export class StandaloneDiffEditor extends DiffEditorWidget implements IStandalon
return <StandaloneCodeEditor>super.getModifiedEditor();
}
public addCommand(keybinding: number, handler: ICommandHandler, context: string): string | null {
public addCommand(keybinding: number, handler: ICommandHandler, context?: string): string | null {
return this.getModifiedEditor().addCommand(keybinding, handler, context);
}
......
......@@ -1071,13 +1071,13 @@ declare namespace monaco.editor {
}
export interface IStandaloneCodeEditor extends ICodeEditor {
addCommand(keybinding: number, handler: ICommandHandler, context: string): string | null;
addCommand(keybinding: number, handler: ICommandHandler, context?: string): string | null;
createContextKey<T>(key: string, defaultValue: T): IContextKey<T>;
addAction(descriptor: IActionDescriptor): IDisposable;
}
export interface IStandaloneDiffEditor extends IDiffEditor {
addCommand(keybinding: number, handler: ICommandHandler, context: string): string | null;
addCommand(keybinding: number, handler: ICommandHandler, context?: string): string | null;
createContextKey<T>(key: string, defaultValue: T): IContextKey<T>;
addAction(descriptor: IActionDescriptor): IDisposable;
getOriginalEditor(): IStandaloneCodeEditor;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册