MCPcopy
hub / github.com/callumalpass/tasknotes / getCurrentTaskForCommand

Method getCurrentTaskForCommand

src/main.ts:1697–1713  ·  view source on GitHub ↗
(
		notTaskNotice = "Current file is not a task"
	)

Source from the content-addressed store, hash-verified

1695 }
1696
1697 private async getCurrentTaskForCommand(
1698 notTaskNotice = "Current file is not a task"
1699 ): Promise<TaskInfo | null> {
1700 const activeFile = this.app.workspace.getActiveFile();
1701 if (!activeFile) {
1702 new Notice("No file is currently open");
1703 return null;
1704 }
1705
1706 const taskInfo = await this.cacheManager.getTaskInfo(activeFile.path);
1707 if (!taskInfo) {
1708 new Notice(notTaskNotice);
1709 return null;
1710 }
1711
1712 return taskInfo;
1713 }
1714
1715 private async getTaskLinkDetectionService(): Promise<TaskLinkDetectionServiceInstance> {
1716 if (!this.taskLinkDetectionService) {

Callers 2

Calls 2

getActiveFileMethod · 0.80
getTaskInfoMethod · 0.65

Tested by

no test coverage detected