Repository navigation
v0.17.0
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— replacingfno longer corruptsg. Line-range splicing rounded to whole lines; byte-range doesn't. - Python decorators come along for the ride.
@functools.cacheabove a function is included in the symbol's byte range. Replace removes both; delete removes both. No orphaned decorators. - TypeScript
exportwrappers are covered.export class Server {}— the range starts atexport, notclass. Replace doesn't leave a danglingexportkeyword. - Leading JSDoc / doc comments expand backward.
/** ... */blocks above a function are included in the symbol range via adjacent-comment walking. - Ruby
classkeyword collision bug eliminated. The old SYMBOL_TYPES walker matched Ruby's literalclasskeyword token (same type name as the wrapping class node), emitting phantomclass:anonymoussymbols. 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_definitionwraps the name insidefunction_declarator. The shippedtags.scmdigs into the declarator natively.
Vendored Query Extensions
Three languages ship tags.scm files that are missing definitions we need:
lib/queries/cpp.scm— addsnamespace_definition(upstream has struct/class/function/enum but no namespace)lib/queries/java.scm— addsenum_declaration,record_declaration,constructor_declaration,annotation_type_declarationlib/queries/bash.scm— full tags.scm (tree-sitter-bash ships onlyhighlights.scm, no tags)
Includes v0.16.1–v0.16.7
- v0.16.7 — Auto-update prereqs:
clwnd updatenow runsclaude update/opencode updatewhen 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.addloadVirtual pinning trap) - v0.16.2 — Fixed
clwnd status/logson Darwin (pipe-to-head swallowed failures) + addedclwnd doctor - v0.16.1 — Dropped
|| 29147port fallback — respect env override or fail loudly