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

Function resolveProjectReference

src/services/taskRelationshipActions.ts:48–65  ·  view source on GitHub ↗
(
	plugin: TaskNotesPlugin,
	projectReference: string,
	sourcePath: string
)

Source from the content-addressed store, hash-verified

46}
47
48function resolveProjectReference(
49 plugin: TaskNotesPlugin,
50 projectReference: string,
51 sourcePath: string
52): string {
53 const trimmedReference = projectReference.trim();
54 if (!trimmedReference) {
55 return "";
56 }
57
58 const linkPath = parseLinkToPath(trimmedReference);
59 const resolvedFile = plugin.app.metadataCache.getFirstLinkpathDest?.(linkPath, sourcePath);
60 if (resolvedFile instanceof TFile) {
61 return buildStableFileLink(plugin, resolvedFile, sourcePath);
62 }
63
64 return trimmedReference;
65}
66
67export async function addTaskToProject(
68 plugin: TaskNotesPlugin,

Calls 2

parseLinkToPathFunction · 0.90
buildStableFileLinkFunction · 0.85

Tested by

no test coverage detected