Skip to content

Commit

Permalink
Merge pull request #87677 from zhengjiaqi/min-app/editor
Browse files Browse the repository at this point in the history
editor action run support params
  • Loading branch information
alexdima authored Feb 4, 2020
2 parents 3d4e0f8 + 5782094 commit b22dd8e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/vs/editor/standalone/browser/standaloneCodeEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
import { ContextKeyExpr, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IContextViewService, IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { ContextViewService } from 'vs/platform/contextview/browser/contextViewService';
import { IInstantiationService, optional } from 'vs/platform/instantiation/common/instantiation';
import { IInstantiationService, optional, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { IThemeService } from 'vs/platform/theme/common/themeService';
Expand Down Expand Up @@ -75,7 +75,7 @@ export interface IActionDescriptor {
* Method that will be executed when the action is triggered.
* @param editor The editor instance is passed in as a convenience
*/
run(editor: ICodeEditor): void | Promise<void>;
run(editor: ICodeEditor, ...args: any[]): void | Promise<void>;
}

/**
Expand Down Expand Up @@ -276,8 +276,8 @@ export class StandaloneCodeEditor extends CodeEditorWidget implements IStandalon
);
const contextMenuGroupId = _descriptor.contextMenuGroupId || null;
const contextMenuOrder = _descriptor.contextMenuOrder || 0;
const run = (): Promise<void> => {
return Promise.resolve(_descriptor.run(this));
const run = (accessor?: ServicesAccessor, ...args: any[]): Promise<void> => {
return Promise.resolve(_descriptor.run(this, ...args));
};


Expand Down
2 changes: 1 addition & 1 deletion src/vs/monaco.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ declare namespace monaco.editor {
* Method that will be executed when the action is triggered.
* @param editor The editor instance is passed in as a convenience
*/
run(editor: ICodeEditor): void | Promise<void>;
run(editor: ICodeEditor, ...args: any[]): void | Promise<void>;
}

/**
Expand Down

0 comments on commit b22dd8e

Please sign in to comment.