You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Return list of notes with a given #hashtag or @mention (singular), with further optional parameters about which (sub)folders to look in, and a term to defeat on etc.
619
-
* Note: since Feb 2025 there is newer mechanism for this: the tagMentionCache, which is much more efficient.
619
+
* Note: in Feb 2025 there @jgclark developed almost all of a newer mechanism for this: the tagMentionCache. But then this suddenly seemed to speed up, after a little refactoring. Mystifying.
620
620
* @author @jgclark
621
621
* @param {string} item - tag/mention name to look for
622
622
* @param {boolean} caseInsensitiveMatch? - whether to ignore case when matching
623
623
* @param {boolean} alsoSearchCalendarNotes? - whether to search calendar notes
624
624
* @param {boolean} excludeSpecialFolders? - whether to ignore regular notes in special folders, i.e. those starting with '@', including @Templates, @Archive and @Trash (optional, defaults to true)
625
625
* @param {Array<string>} itemsToExclude - optional list of tags/mentions that if found in the note, excludes the note
626
626
* @param {string?} folder - optional folder to limit to
627
-
* @param {boolean} includeSubfolders? - if folder given, whether to look in subfolders of this folder or not
627
+
* @param {boolean?} includeSubfolders? - if folder given, whether to look in subfolders of this folder or not (optional, defaults to false)
628
628
* @return {Array<TNote>}
629
629
*/
630
630
export function findNotesMatchingHashtagOrMention(
@@ -634,7 +634,7 @@ export function findNotesMatchingHashtagOrMention(
634
634
excludeSpecialFolders: boolean,
635
635
itemsToExclude: Array<string> = [],
636
636
folder: ?string,
637
-
includeSubfolders: boolean,
637
+
includeSubfolders?: boolean = false,
638
638
): Array<TNote> {
639
639
try {
640
640
// Check for special conditions first
@@ -718,7 +718,6 @@ export function findNotesMatchingHashtagOrMention(
718
718
719
719
/**
720
720
* From a given array of notes, return the subset with a given #hashtag or @mention (singular), with further optional parameters about which (sub)folders to look in, and a term to defeat on etc.
721
-
* Note: since Feb 2025 there is newer mechanism for this: the tagMentionCache, which is much more efficient.
722
721
* @author@jgclark
723
722
* @param {string} item - tag/mention name to look for
724
723
* @param {Array<TNote>} notesToSearchIn - array of notes to search in
* WARNING: In a weird development (literally), I found that a refactor of the original findNotesWithMatchingHashtag() suddenly made it now as fast, if not faster, as this new Cache.
9
+
* I didn't take out any code, so I'm mystified.
10
+
* But not complaining, particularly as this still had some work required.
11
+
*/
12
+
7
13
importmomentfrom'moment/min/moment-with-locales'
8
14
// import { getDateStringFromCalendarFilename, getTodaysDateHyphenated } from '@helpers/dateTime'
0 commit comments