( notTaskNotice = "Current file is not a task" )
| 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) { |
no test coverage detected