FindMyFiles

FindMyFiles.Highlighting Namespace

Classes
CompiledHighlighterA query compiled into the positive text needles worth highlighting. Pure (no WinUI), so it is unit-testable and reusable across rows. Built once per query by Compile(string) and queried per displayed string by Ranges(string, HighlightField). Highlighting deliberately mirrors only the *simple, certain* slice of the engine's match semantics (fmf-core query/): plain substrings, anchored lit*/*lit/*lit* wildcards, and smart-case folding (engine/crates/fmf-core/src/wtf8.rs). Anything the UI cannot reproduce exactly — user regex, general wildcards, negation, path wildcards — is left un-highlighted rather than guessed at: a row the engine returned is never hidden, only its emphasis is skipped (don't crash / don't go silent). This guarantees the UI never lights up a position the engine did not actually match.
HighlightSegmenterSplits a string into consecutive highlighted/plain segments from a set of merged ranges — the pure, unit-tested core of the highlight renderer, kept free of WinUI so it runs headless. Ranges are clamped to the string, so a stale or out-of-bounds range can never throw.
HighlightTextAttached behavior that renders SourceProperty into a TextBlock's Inlines, emphasizing the spans named by RangesProperty with bold + accent foreground. Lets the result list's name/path cells show match highlights without giving up their TextBlock styles, x:Phase, or virtualization: the same cell instance is reused across rows, and FindMyFiles.Highlighting.HighlightText.Rebuild(Microsoft.UI.Xaml.Controls.TextBlock,System.String,System.Collections.Generic.IReadOnlyList{FindMyFiles.Highlighting.HighlightRange}) clears and refills it on every change so a reused container never shows the previous row's text.
MatchHighlighterCompiles query text into a CompiledHighlighter. Mirrors the engine tokenizer/compiler (engine/crates/fmf-core/src/query/ast.rs and compile.rs) for the subset that can be highlighted exactly, and drops the rest (see CompiledHighlighter).
RegexHighlighterHighlights a whole-query regex (regex mode) by re-matching the displayed string. Emphasizes the name field for a name-scope pattern and the path field for a path-scope one — the same field the engine matched, so ResultRow's parent/name split applies unchanged. A match-timeout (or any mismatch with the engine's rust regex) simply yields no ranges: a row the engine returned is never hidden, only its emphasis is skipped.
Structs
HighlightRangeA half-open run of UTF-16 code units to emphasize, in the coordinate space of the string handed to Ranges(string, HighlightField).
HighlightSegmentOne piece of a string for highlighted rendering.
Interfaces
IHighlighterA compiled query that can emphasize the slices of a displayed string it matched. Implemented by the substring/wildcard CompiledHighlighter and the whole-query RegexHighlighter; the results list and rows depend only on this seam.
Enums
HighlightFieldWhich displayed string a highlight term is matched against — the file name leaf, or the full path (parent + name).