Repository navigation
v0.11.1
Release Notes — Newline Query + Query Engine Optimization
Query.Newlineis now explicitly defined as “node occurs after a newline” where a match is true if the node has leading newline trivia OR the previous sibling has trailing newline trivia.- Newline detection is faster and allocation-free in green matching by using token-centric boundary flags (
HasLeadingNewlineTrivia/HasTrailingNewlineTrivia) rather than scanning trivia. - Green-node flag semantics are clarified and enforced: boundary trivia flags are token-owned; container/list nodes do not inherit boundary flags from their first/last child (they only aggregate
Contains*subtree flags). - Query engine hot paths were tightened by removing LINQ from selection modes and commonly used combinators/
Select(...)implementations, reducing iterator/closure allocations while preserving document order/semantics. SyntaxEditorregion resolution was optimized to materializeNodePathonly on match (less allocation during region-heavy edits).- Test coverage expanded for newline semantics and for green-flag correctness across editor mutations + undo/redo.
- Added a targeted benchmark suite for
SyntaxTree.Select(Query.Newline); benchmark runner is back to discovering/running all benchmarks by default (filters still supported).
Performance (NewlineQueryBenchmarks, current vs master, fixed warmup/iterations/outlier removal)
Select(Query.Newline) - Count: ~5–10% faster, allocations essentially unchangedSelect(Query.Newline.First()) - First match: ~14–15% faster, ~6–7% less allocated