MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / openTaskNote

Method openTaskNote

src/modals/TaskEditModal.ts:591–615  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

589 }
590
591 protected async openTaskNote(): Promise<void> {
592 try {
593 // Get the file from the task path
594 const file = this.app.vault.getAbstractFileByPath(this.task.path);
595
596 if (!(file instanceof TFile)) {
597 new Notice(this.t("modals.taskEdit.notices.fileMissing", { path: this.task.path }));
598 return;
599 }
600
601 // Open the file in a new leaf
602 const leaf = this.app.workspace.getLeaf(true);
603 await leaf.openFile(file);
604
605 // Close the modal
606 this.close();
607 } catch (error) {
608 tasknotesLogger.error("Failed to open task note:", {
609 category: "persistence",
610 operation: "open-task-note",
611 error: error,
612 });
613 new Notice(this.t("modals.taskEdit.notices.openNoteFailure"));
614 }
615 }
616
617 private async archiveTask(): Promise<void> {
618 try {

Callers 2

createActionButtonsMethod · 0.95
createActionButtonsFunction · 0.45

Calls 5

closeMethod · 0.95
getAbstractFileByPathMethod · 0.80
getLeafMethod · 0.80
errorMethod · 0.80
tMethod · 0.45

Tested by

no test coverage detected