SIGN IN SIGN UP

fix(parser): index TS interfaces/type aliases and emit type-position edges

TypeScript and TSX listed only class_declaration in _CLASS_TYPES, so
interfaces, type aliases, and enums were never indexed. A types-only
module (types.ts, *.d.ts) contributed zero symbol nodes and its blast
radius collapsed to whole-file IMPORTS_FROM fan-out, while Java, C#, and
PHP already indexed interface_declaration.

- Add interface_declaration, type_alias_declaration, and enum_declaration
  to _CLASS_TYPES for typescript/tsx.
- Emit REFERENCES edges from type positions (annotations, type arguments)
  so a type has traceable dependents. REFERENCES (0.6) rather than CALLS
  (1.0) keeps type churn below call churn in impact ranking. The
  declaration's own name is skipped, as are heritage clauses that already
  produce INHERITS.
- Fix _get_bases for TS: class heritage nests under class_heritage and
  interfaces use extends_type_clause, so scanning only direct children
  found no bases at all — `class C extends B` emitted no INHERITS edge.

Measured on this repo's own code-review-graph-vscode extension (17 .ts
files): Class nodes 15 -> 40, REFERENCES 4 -> 164, INHERITS 0 -> 5, CALLS
unchanged at 1095, build time 0.93s -> 1.04s.

Fixes #737
N
nhatvu148 committed
f28862e9fde44c55d6e88ae279a4ebc39c17750e
Parent: 329dbb9
Committed by Tirth Kanani <tirthkanani18@gmail.com> on 7/27/2026, 6:42:56 PM