MCPcopy Create free account
hub / github.com/callumalpass/tasknotes / addProject

Function addProject

src/modals/TaskModal.ts:1078–1093  ·  view source on GitHub ↗
(file: TAbstractFile)

Source from the content-addressed store, hash-verified

1076 }
1077
1078 protected addProject(file: TAbstractFile): void {
1079 if (file instanceof TFile) {
1080 const projectItem = createTaskModalProjectItemFromFile(
1081 file,
1082 this.buildProjectReference(file, this.getCurrentTaskPath() || "")
1083 );
1084
1085 if (hasTaskModalProjectItem(this.selectedProjectItems, projectItem)) {
1086 return;
1087 }
1088
1089 this.selectedProjectItems.push(projectItem);
1090 }
1091 this.updateProjectsFromFiles();
1092 this.renderProjectsList();
1093 }
1094
1095 protected removeProject(item: TaskModalProjectItem): void {
1096 this.selectedProjectItems = removeTaskModalProjectItem(this.selectedProjectItems, item);

Callers

nothing calls this directly

Calls 4

hasTaskModalProjectItemFunction · 0.90
buildProjectReferenceMethod · 0.80
getCurrentTaskPathMethod · 0.80

Tested by

no test coverage detected