Skip to content

Commit 0493a15

Browse files
committed
refactor: . Extract taskLocation
1 parent 3a5f983 commit 0493a15

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/Obsidian/FileParser.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,19 @@ export function parseFileContent(
7474
continue;
7575
}
7676

77+
const taskLocation = new TaskLocation(
78+
tasksFile,
79+
lineNumber,
80+
currentSection.position.start.line,
81+
sectionIndex,
82+
Cache.getPrecedingHeader(lineNumber, fileCache.headings),
83+
);
7784
if (listItem.task !== undefined) {
7885
let task;
7986
try {
8087
task = Task.fromLine({
8188
line,
82-
taskLocation: new TaskLocation(
83-
tasksFile,
84-
lineNumber,
85-
currentSection.position.start.line,
86-
sectionIndex,
87-
Cache.getPrecedingHeader(lineNumber, fileCache.headings),
88-
),
89+
taskLocation: taskLocation,
8990
fallbackDate: dateFromFileName.value,
9091
});
9192

0 commit comments

Comments
 (0)