Fix treeshaking problems

This commit is contained in:
Alex Dima
2021-12-06 19:18:11 +01:00
parent 726f1252b1
commit 7663e88b07
5 changed files with 31 additions and 66 deletions

View File

@@ -351,25 +351,6 @@ export abstract class EditorAction extends EditorCommand {
public abstract run(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void | Promise<void>;
}
interface IEditorContributionCtorWithGet<T extends IEditorContribution> {
get(editor: ICodeEditor): T | null;
}
export abstract class EditorControllerAction<T extends IEditorContribution> extends EditorAction {
protected abstract controller: IEditorContributionCtorWithGet<T>;
run(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void | Promise<void> {
const controller = this.controller.get(editor);
if (!controller) {
return;
}
return this.runControllerAction(accessor, editor, controller, args);
}
abstract runControllerAction(accessor: ServicesAccessor, editor: ICodeEditor, controller: T, args: any): void | Promise<void>;
}
export type EditorActionImplementation = (accessor: ServicesAccessor, editor: ICodeEditor, args: any) => boolean | Promise<void>;
export class MultiEditorAction extends EditorAction {