Skip to content

v0.11.1

Choose a tag to compare

@dsisco11 dsisco11 released this 11 Jan 13:20
· 4 commits to master since this release
bc694ba

Release Notes — Newline Query + Query Engine Optimization

  • Query.Newline is 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.
  • SyntaxEditor region resolution was optimized to materialize NodePath only 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 unchanged
  • Select(Query.Newline.First()) - First match: ~14–15% faster, ~6–7% less allocated