未验证 提交 b22dd8e6 编写于 作者: A Alexandru Dima 提交者: GitHub

Merge pull request #87677 from zhengjiaqi/min-app/editor

editor action run support params
...@@ -23,7 +23,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur ...@@ -23,7 +23,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
import { ContextKeyExpr, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { ContextKeyExpr, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IContextViewService, IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IContextViewService, IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { ContextViewService } from 'vs/platform/contextview/browser/contextViewService'; 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 { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { INotificationService } from 'vs/platform/notification/common/notification'; import { INotificationService } from 'vs/platform/notification/common/notification';
import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IThemeService } from 'vs/platform/theme/common/themeService';
...@@ -75,7 +75,7 @@ export interface IActionDescriptor { ...@@ -75,7 +75,7 @@ export interface IActionDescriptor {
* Method that will be executed when the action is triggered. * Method that will be executed when the action is triggered.
* @param editor The editor instance is passed in as a convenience * @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>;
} }
/** /**
...@@ -276,8 +276,8 @@ export class StandaloneCodeEditor extends CodeEditorWidget implements IStandalon ...@@ -276,8 +276,8 @@ export class StandaloneCodeEditor extends CodeEditorWidget implements IStandalon
); );
const contextMenuGroupId = _descriptor.contextMenuGroupId || null; const contextMenuGroupId = _descriptor.contextMenuGroupId || null;
const contextMenuOrder = _descriptor.contextMenuOrder || 0; const contextMenuOrder = _descriptor.contextMenuOrder || 0;
const run = (): Promise<void> => { const run = (accessor?: ServicesAccessor, ...args: any[]): Promise<void> => {
return Promise.resolve(_descriptor.run(this)); return Promise.resolve(_descriptor.run(this, ...args));
}; };
......
...@@ -1046,7 +1046,7 @@ declare namespace monaco.editor { ...@@ -1046,7 +1046,7 @@ declare namespace monaco.editor {
* Method that will be executed when the action is triggered. * Method that will be executed when the action is triggered.
* @param editor The editor instance is passed in as a convenience * @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>;
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册