Expose actions registry (#701)
This commit is contained in:
parent
db39eacfa1
commit
0462a93f11
6
packages/ide-api/api.d.ts
vendored
6
packages/ide-api/api.d.ts
vendored
@ -1,6 +1,9 @@
|
|||||||
// tslint:disable no-any
|
// tslint:disable no-any
|
||||||
|
|
||||||
import { ITerminalService } from "vs/workbench/contrib/terminal/common/terminal";
|
import { ITerminalService } from "vs/workbench/contrib/terminal/common/terminal";
|
||||||
|
import { IWorkbenchActionRegistry } from 'vs/workbench/common/actions';
|
||||||
|
import { Action } from 'vs/base/common/actions';
|
||||||
|
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
|
||||||
|
|
||||||
export interface EvalHelper { }
|
export interface EvalHelper { }
|
||||||
interface ActiveEvalEmitter {
|
interface ActiveEvalEmitter {
|
||||||
@ -146,7 +149,10 @@ declare namespace ide {
|
|||||||
export const client: {};
|
export const client: {};
|
||||||
|
|
||||||
export const workbench: {
|
export const workbench: {
|
||||||
|
readonly action: Action,
|
||||||
|
readonly syncActionDescriptor: SyncActionDescriptor,
|
||||||
readonly statusbarService: IStatusbarService;
|
readonly statusbarService: IStatusbarService;
|
||||||
|
readonly actionsRegistry: IWorkbenchActionRegistry;
|
||||||
readonly notificationService: INotificationService;
|
readonly notificationService: INotificationService;
|
||||||
readonly storageService: IStorageService;
|
readonly storageService: IStorageService;
|
||||||
readonly menuRegistry: IMenuRegistry;
|
readonly menuRegistry: IMenuRegistry;
|
||||||
|
@ -6,13 +6,17 @@ import { IStatusbarService, StatusbarAlignment } from "vs/platform/statusbar/com
|
|||||||
import * as paths from "./fill/paths";
|
import * as paths from "./fill/paths";
|
||||||
import product from "./fill/product";
|
import product from "./fill/product";
|
||||||
import "./vscode.scss";
|
import "./vscode.scss";
|
||||||
import { MenuId, MenuRegistry } from "vs/platform/actions/common/actions";
|
import { Action } from 'vs/base/common/actions';
|
||||||
|
import { SyncActionDescriptor, MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';
|
||||||
|
import { Registry } from 'vs/platform/registry/common/platform';
|
||||||
|
import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions';
|
||||||
import { CommandsRegistry } from "vs/platform/commands/common/commands";
|
import { CommandsRegistry } from "vs/platform/commands/common/commands";
|
||||||
import { IFileService, FileOperation } from "vs/platform/files/common/files";
|
import { IFileService, FileOperation } from "vs/platform/files/common/files";
|
||||||
import { ITextFileService } from "vs/workbench/services/textfile/common/textfiles";
|
import { ITextFileService } from "vs/workbench/services/textfile/common/textfiles";
|
||||||
import { IModelService } from "vs/editor/common/services/modelService";
|
import { IModelService } from "vs/editor/common/services/modelService";
|
||||||
import { ITerminalService } from "vs/workbench/contrib/terminal/common/terminal";
|
import { ITerminalService } from "vs/workbench/contrib/terminal/common/terminal";
|
||||||
import { IStorageService } from "vs/platform/storage/common/storage";
|
import { IStorageService } from "vs/platform/storage/common/storage";
|
||||||
|
|
||||||
// NOTE: shouldn't import anything from VS Code here or anything that will
|
// NOTE: shouldn't import anything from VS Code here or anything that will
|
||||||
// depend on a synchronous fill like `os`.
|
// depend on a synchronous fill like `os`.
|
||||||
|
|
||||||
@ -33,11 +37,12 @@ class VSClient extends IdeClient {
|
|||||||
window.ide = {
|
window.ide = {
|
||||||
client: ideClientInstance,
|
client: ideClientInstance,
|
||||||
workbench: {
|
workbench: {
|
||||||
|
action: Action,
|
||||||
|
syncActionDescriptor: SyncActionDescriptor,
|
||||||
commandRegistry: CommandsRegistry,
|
commandRegistry: CommandsRegistry,
|
||||||
// tslint:disable-next-line:no-any
|
actionsRegistry: Registry.as<IWorkbenchActionRegistry>(Extensions.WorkbenchActions),
|
||||||
menuRegistry: MenuRegistry as any,
|
menuRegistry: MenuRegistry,
|
||||||
// tslint:disable-next-line:no-any
|
statusbarService: getService<IStatusbarService>(IStatusbarService),
|
||||||
statusbarService: getService<IStatusbarService>(IStatusbarService) as any,
|
|
||||||
notificationService: getService<INotificationService>(INotificationService),
|
notificationService: getService<INotificationService>(INotificationService),
|
||||||
terminalService: getService<ITerminalService>(ITerminalService),
|
terminalService: getService<ITerminalService>(ITerminalService),
|
||||||
storageService: {
|
storageService: {
|
||||||
|
Reference in New Issue
Block a user