Problem
import { foo as bar } from './utils' stores bar in symbols_referenced, but the actual symbol in ./utils is foo. When someone deletes foo, the stored reference bar doesn't match — missed detection.
Location: collectImportNames() in src/parser/ast.ts, line 255:
const localName = (spec.childForFieldName('alias') ?? spec.childForFieldName('name'))?.text;
This prefers the alias over the original name.
Fix
Use spec.childForFieldName('name') (the original export name) instead of preferring alias. One-line change.
Severity
Causes silent missed detections for any codebase that renames imports.
Reproduction
- PR A adds
export function foo() in utils.ts
- PR B adds
import { foo as bar } from './utils' — stores reference as bar
- PR C deletes
foo from utils.ts — deleted symbol is foo
symbolMatches compares bar vs foo → no match → regression missed
Problem
import { foo as bar } from './utils'storesbarinsymbols_referenced, but the actual symbol in./utilsisfoo. When someone deletesfoo, the stored referencebardoesn't match — missed detection.Location:
collectImportNames()insrc/parser/ast.ts, line 255:This prefers the alias over the original name.
Fix
Use
spec.childForFieldName('name')(the original export name) instead of preferringalias. One-line change.Severity
Causes silent missed detections for any codebase that renames imports.
Reproduction
export function foo()inutils.tsimport { foo as bar } from './utils'— stores reference asbarfoofromutils.ts— deleted symbol isfoosymbolMatchescomparesbarvsfoo→ no match → regression missed