Skip to content

v0.17.0

Choose a tag to compare

@github-actions github-actions released this 11 Apr 22:30
· 434 commits to main since this release

v0.17.0 — Query-Based Symbol Extraction + Byte-Range Edits

The AST engine in lib/ast.ts has been rebuilt on tree-sitter's Query API. Symbols are now extracted via the maintainer-blessed queries/tags.scm files that ship with each grammar — the same patterns that power GitHub's code navigation. Edits splice by byte range instead of line range.

Architecture Shift

Before After
Hand-rolled walker over a 50-entry SYMBOL_TYPES dict Query.matches() against tags.scm from each grammar package
Splice by line range (lines.slice(startLine-1, endLine)) Splice by byte range (source.slice(startIndex, endIndex))
Decorators / export / JSDoc orphaned on replace Wrapper expansion + adjacent comment walk includes them in range
500KB file size limit 5MB

What This Fixes

  • Single-line code is safe to edit. def f(): pass; def g(): pass — replacing f no longer corrupts g. Line-range splicing rounded to whole lines; byte-range doesn't.
  • Python decorators come along for the ride. @functools.cache above a function is included in the symbol's byte range. Replace removes both; delete removes both. No orphaned decorators.
  • TypeScript export wrappers are covered. export class Server {} — the range starts at export, not class. Replace doesn't leave a dangling export keyword.
  • Leading JSDoc / doc comments expand backward. /** ... */ blocks above a function are included in the symbol range via adjacent-comment walking.
  • Ruby class keyword collision bug eliminated. The old SYMBOL_TYPES walker matched Ruby's literal class keyword token (same type name as the wrapping class node), emitting phantom class:anonymous symbols. Queries match on AST shapes, not bare type names.
  • C/C++ function names resolved natively. The old code needed a custom declarator-chain walker because C's function_definition wraps the name inside function_declarator. The shipped tags.scm digs into the declarator natively.

Vendored Query Extensions

Three languages ship tags.scm files that are missing definitions we need:

  • lib/queries/cpp.scm — adds namespace_definition (upstream has struct/class/function/enum but no namespace)
  • lib/queries/java.scm — adds enum_declaration, record_declaration, constructor_declaration, annotation_type_declaration
  • lib/queries/bash.scm — full tags.scm (tree-sitter-bash ships only highlights.scm, no tags)

Includes v0.16.1–v0.16.7

  • v0.16.7 — Auto-update prereqs: clwnd update now runs claude update / opencode update when below minimum pin instead of silently exiting
  • v0.16.6 — Explicit lazy-loading guarantee for all 12 grammar packages in tsup externals
  • v0.16.5 — Added 7 grammars: java, c, cpp, ruby, php, c#, bash. Honest two-tier tool description
  • v0.16.4 — Pinned tree-sitter grammars to ABI-compatible versions (python/js/go were broken at 0.25.x against host 0.21.1)
  • v0.16.3 — Install script wipes OC's stale plugin cache on every update (breaks the Npm.add loadVirtual pinning trap)
  • v0.16.2 — Fixed clwnd status/logs on Darwin (pipe-to-head swallowed failures) + added clwnd doctor
  • v0.16.1 — Dropped || 29147 port fallback — respect env override or fail loudly