generated from obsidianmd/obsidian-sample-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2612 from obsidian-tasks-group/reduce-cyclic-deps
refactor: Reduce cyclic dependencies in src/
- Loading branch information
Showing
39 changed files
with
163 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Processed 152 files (995ms) (16 warnings) | ||
|
||
1) Config/Settings.ts > Suggestor/Suggestor.ts | ||
2) Task/Task.ts > Config/Settings.ts > Suggestor/Suggestor.ts | ||
3) Task/Task.ts > Config/Settings.ts > Suggestor/Suggestor.ts > TaskSerializer/DefaultTaskSerializer.ts | ||
4) Task/Task.ts > Config/Settings.ts > TaskSerializer/DataviewTaskSerializer.ts | ||
5) Task/Task.ts > Task/DateFallback.ts | ||
6) Task/Task.ts > Task/Urgency.ts | ||
7) Task/Task.ts > lib/LogTasksHelper.ts | ||
8) Query/Query.ts > Query/Explain/Explainer.ts | ||
9) Query/FilterParser.ts > Query/Filter/BooleanField.ts | ||
10) main.ts > Config/SettingsTab.ts | ||
11) Obsidian/Cache.ts > Obsidian/TasksEvents.ts | ||
12) main.ts > Renderer/QueryRenderer.ts | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* When sorting, make sure low always comes after none. This way any tasks with low will be below any exiting | ||
* tasks that have no priority which would be the default. | ||
* | ||
* Values can be converted to strings with: | ||
* - {@link priorityNameUsingNone} in {@link PriorityTools} | ||
* - {@link priorityNameUsingNormal} in {@link PriorityTools} | ||
* | ||
* @export | ||
* @enum {number} | ||
*/ | ||
export enum Priority { | ||
Highest = '0', | ||
High = '1', | ||
Medium = '2', | ||
None = '3', | ||
Low = '4', | ||
Lowest = '5', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
export class TaskRegularExpressions { | ||
public static readonly dateFormat = 'YYYY-MM-DD'; | ||
public static readonly dateTimeFormat = 'YYYY-MM-DD HH:mm'; | ||
|
||
// Matches indentation before a list marker (including > for potentially nested blockquotes or Obsidian callouts) | ||
public static readonly indentationRegex = /^([\s\t>]*)/; | ||
|
||
// Matches - * and + list markers, or numbered list markers (eg 1.) | ||
public static readonly listMarkerRegex = /([-*+]|[0-9]+\.)/; | ||
|
||
// Matches a checkbox and saves the status character inside | ||
public static readonly checkboxRegex = /\[(.)\]/u; | ||
|
||
// Matches the rest of the task after the checkbox. | ||
public static readonly afterCheckboxRegex = / *(.*)/u; | ||
|
||
// Main regex for parsing a line. It matches the following: | ||
// - Indentation | ||
// - List marker | ||
// - Status character | ||
// - Rest of task after checkbox markdown | ||
// See Task.extractTaskComponents() for abstraction around this regular expression. | ||
// That is private for now, but could be made public in future if needed. | ||
public static readonly taskRegex = new RegExp( | ||
TaskRegularExpressions.indentationRegex.source + | ||
TaskRegularExpressions.listMarkerRegex.source + | ||
' +' + | ||
TaskRegularExpressions.checkboxRegex.source + | ||
TaskRegularExpressions.afterCheckboxRegex.source, | ||
'u', | ||
); | ||
|
||
// Used with the "Create or Edit Task" command to parse indentation and status if present | ||
public static readonly nonTaskRegex = new RegExp( | ||
TaskRegularExpressions.indentationRegex.source + | ||
TaskRegularExpressions.listMarkerRegex.source + | ||
'? *(' + | ||
TaskRegularExpressions.checkboxRegex.source + | ||
')?' + | ||
TaskRegularExpressions.afterCheckboxRegex.source, | ||
'u', | ||
); | ||
|
||
// Used with "Toggle Done" command to detect a list item that can get a checkbox added to it. | ||
public static readonly listItemRegex = new RegExp( | ||
TaskRegularExpressions.indentationRegex.source + TaskRegularExpressions.listMarkerRegex.source, | ||
); | ||
|
||
// Match on block link at end. | ||
public static readonly blockLinkRegex = / \^[a-zA-Z0-9-]+$/u; | ||
|
||
// Regex to match all hash tags, basically hash followed by anything but the characters in the negation. | ||
// To ensure URLs are not caught it is looking of beginning of string tag and any | ||
// tag that has a space in front of it. Any # that has a character in front | ||
// of it will be ignored. | ||
// EXAMPLE: | ||
// description: '#dog #car http://www/ddd#ere #house' | ||
// matches: #dog, #car, #house | ||
// MAINTENANCE NOTE: | ||
// If hashTags is modified, please update 'Recognising Tags' in Tags.md in the docs. | ||
public static readonly hashTags = /(^|\s)#[^ !@#$%^&*(),.?":{}|<>]+/g; | ||
public static readonly hashTagsFromEnd = new RegExp(this.hashTags.source + '$'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.