v0.7.0
Minor Changes
-
#84
e003218Thanks @SutuSebastian! -symbols.kinddistinguishesconst/let/varinstead of collapsing all three into'const'. Schema bumpSCHEMA_VERSION26 → 27 — first run after upgrade auto-rebuilds.codemap/index.dbvia the existing version-mismatch path; consumer queries see the new values immediately.What changes:
let x = 1now emitskind = 'let'+signature = 'let x'.var y = 2now emitskind = 'var'+signature = 'var y'.const z = 3unchanged (kind = 'const'+signature = 'const z').- Destructuring patterns inherit the declaration keyword:
let { a, b } = obj→ bothaandbarekind = 'let'. for (let x of arr) { ... }body bindings inherit the keyword (kind = 'let').- Arrow / function init still wins over the keyword:
const handler = () => 1andlet handler = () => 1both emitkind = 'function'.
Breaking — but pre-v1 the breakage IS the fix. Any query that filtered
WHERE kind = 'const'to mean “all variable bindings” was silently over-matching everyletandvar. Post-upgrade the filter is precise; queries that wanted the over-match should widen toWHERE kind IN ('const', 'let', 'var'). Affected paths in this PR: the40-query-patterns.mdconst-values example (now demonstrates the precise filter + adds two new patterns that depend on it — “lets that should be const” and “consts that get illegally written”), andfind-write-sites.mdprose where the recipe’s documented JOIN trick now works as described.Mutability filters that finally work:
-- bindings declared `let` but never reassigned — candidates to tighten to `const` SELECT s.name, s.file_path, s.line_start FROM symbols s WHERE s.kind = 'let' AND NOT EXISTS ( SELECT 1 FROM "references" r WHERE r.name = s.name AND r.file_path = s.file_path AND r.is_write = 1 AND r.line_start > s.line_start ); -- `const`s that get reassigned anyway (TypeScript usually catches it; queryable here for completeness) SELECT s.name, s.file_path, s.line_start FROM symbols s JOIN "references" r ON r.name = s.name AND r.file_path = s.file_path WHERE s.kind = 'const' AND r.is_write = 1 AND r.line_start > s.line_start;find-symbol-by-kindrecipe params updated to enumerate the new values explicitly.file_metricskeyword counts populate too —let_count/const_count/var_countwere previously hardcoded to0(// let/const/var distinction not yet trackedper the in-source TODO). They now reflect the actual per-file counts.docs/architecture.md§file_metricsdrops the “Reserved (parser-keyword variant TBD)” notes.