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

Method applyParentNoteProjectDefault

src/main.ts:1194–1208  ·  view source on GitHub ↗
(
		prePopulatedValues: Partial<TaskInfo> | undefined,
		context: ParentNoteProjectDefaultContext
	)

Source from the content-addressed store, hash-verified

1192 }
1193
1194 private applyParentNoteProjectDefault(
1195 prePopulatedValues: Partial<TaskInfo> | undefined,
1196 context: ParentNoteProjectDefaultContext
1197 ): Partial<TaskInfo> | undefined {
1198 if (!shouldApplyParentNoteProjectDefault(this.settings.taskCreationDefaults, context)) {
1199 return prePopulatedValues;
1200 }
1201
1202 const currentFile = this.app.workspace.getActiveFile();
1203 const parentNote = currentFile
1204 ? this.app.fileManager.generateMarkdownLink(currentFile, currentFile.path)
1205 : undefined;
1206
1207 return applyParentNoteProjectDefault(prePopulatedValues, parentNote);
1208 }
1209
1210 /**
1211 * Convert the current note to a task by adding required task frontmatter.

Callers 2

openTaskCreationModalMethod · 0.95
createInlineTaskMethod · 0.95

Calls 4

getActiveFileMethod · 0.80
generateMarkdownLinkMethod · 0.80

Tested by

no test coverage detected