public static class CandidateScannerFinds the class names a project might be using.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Deliberately over-inclusive, and that is the whole design. It does not parse VXML or C#; it pulls out every run of characters that could be a class name and lets the generator throw away what is not one. A false positive costs one unused rule that no element matches; a false negative is a style silently missing at runtime, which someone debugs for an hour. The asymmetry is enormous and the design follows it.
It also means the scanner cannot be defeated by cleverness, which a parser can. A class name built by string concatenation is invisible to any analysis, but the pieces are usually literals, and a scanner that takes every literal finds them.
The one thing it must not do is find so much that generation slows down. Runs are bounded by the characters a utility can contain, which excludes whitespace, quotes and most punctuation, so a paragraph of prose yields its words and nothing longer.
⚠ Exactly one input is narrowed, and it is narrowed by structure rather than by judgement. ScanStyleSheet skips a declaration's value, because a class name cannot be used from the right of a colon and position: absolute is otherwise indistinguishable from class="absolute". That is a fact about where CSS puts class names, not a guess about which candidates are real, so it takes nothing away from the asymmetry above — and it is deliberately not generalised to C# or .vxml, where a colon means whatever the language it was written in says it means.
Methods (2)
public static void Scan(string text, ISet<string> into)Pulls candidate class names out of a file's text.
public static void ScanStyleSheet(string text, ISet<string> into)Pulls candidate class names out of a stylesheet, skipping declaration values.
Used by (3)
- ArbitraryPropertyTestsVixen.Ui.Styling.Utilities.Tests
- ThemeAndScannerTestsVixen.Ui.Styling.Utilities.Tests
- StyleGenRunnerVixen.StyleGen