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

Method getTaskLinkAtCursor

src/main.ts:1726–1742  ·  view source on GitHub ↗
(
		editor: Editor,
		detectionService: TaskLinkDetectionServiceInstance
	)

Source from the content-addressed store, hash-verified

1724 }
1725
1726 private getTaskLinkAtCursor(
1727 editor: Editor,
1728 detectionService: TaskLinkDetectionServiceInstance
1729 ): TaskLinkMatch | null {
1730 const cursor = editor.getCursor();
1731 const line = editor.getLine(cursor.line);
1732 const links = detectionService.findWikilinks(line);
1733
1734 return (
1735 links.find(
1736 (link) =>
1737 cursor.ch >= link.start &&
1738 cursor.ch <= link.end &&
1739 (link.type === "wikilink" || link.type === "markdown")
1740 ) ?? null
1741 );
1742 }
1743
1744 private async openTaskEditModalForFile(file: TFile, notTaskNotice?: string): Promise<void> {
1745 try {

Callers 1

Calls 3

getCursorMethod · 0.80
getLineMethod · 0.80
findWikilinksMethod · 0.80

Tested by

no test coverage detected