MCPcopy Create free account
hub / github.com/chhoumann/quickadd / executeEditorCommand

Method executeEditorCommand

src/engine/MacroChoiceEngine.ts:586–623  ·  view source on GitHub ↗
(command: IEditorCommand)

Source from the content-addressed store, hash-verified

584 }
585
586 private async executeEditorCommand(command: IEditorCommand) {
587 switch (command.editorCommandType) {
588 case EditorCommandType.Cut:
589 await CutCommand.run(this.app);
590 break;
591 case EditorCommandType.Copy:
592 await CopyCommand.run(this.app);
593 break;
594 case EditorCommandType.Paste:
595 await PasteCommand.run(this.app);
596 break;
597 case EditorCommandType.PasteWithFormat:
598 await PasteWithFormatCommand.run(this.app);
599 break;
600 case EditorCommandType.SelectActiveLine:
601 SelectActiveLineCommand.run(this.app);
602 break;
603 case EditorCommandType.SelectLinkOnActiveLine:
604 SelectLinkOnActiveLineCommand.run(this.app);
605 break;
606 case EditorCommandType.MoveCursorToFileStart:
607 MoveCursorToFileStartCommand.run(this.app);
608 break;
609 case EditorCommandType.MoveCursorToFileEnd:
610 MoveCursorToFileEndCommand.run(this.app);
611 break;
612 case EditorCommandType.MoveCursorToLineStart:
613 MoveCursorToLineStartCommand.run(this.app);
614 break;
615 case EditorCommandType.MoveCursorToLineEnd:
616 MoveCursorToLineEndCommand.run(this.app);
617 break;
618 default: {
619 const exhaustiveCheck: never = command.editorCommandType;
620 throw new Error(`Unhandled editor command type: ${exhaustiveCheck}`);
621 }
622 }
623 }
624
625 private async executeAIAssistant(command: IAIAssistantCommand) {
626 if (settingsStore.getState().disableOnlineFeatures) {

Callers 1

executeCommandsMethod · 0.95

Calls 1

runMethod · 0.45

Tested by

no test coverage detected