Files
codegraph/__tests__
Colby MchenryandClaude Opus 5.5 80c3680068 fix(extraction): drop the extractVariables hook, which the core never called (#2809)
Root cause: LanguageExtractor in src/extraction/tree-sitter-types.ts declared
an optional extractVariables hook, documented together with the VariableInfo
type it returned, but nothing ever called it. Variables are named by the
core's own extractVariable, from its per-language branches and the
variableTypes list. A language author who wrote the hook got nothing back,
with no error and no warning; the reporter hit this while adding Nim.

Fix: remove the hook and VariableInfo. No language implemented the hook,
nothing else referred to either one, and the module is not part of the
public API. The variableTypes doc now says how the core finds the declared
names, and that a grammar which nests them deeper gets its own branch in
extractVariable, as the add-lang skill already says. Wiring the hook in was
the alternative, but nothing needs it, so it would be an API no language
exercises; the open Nim PR uses a core branch instead.

Validation:
- New __tests__/language-extractor-hooks.test.ts reads LanguageExtractor's
  members with the TypeScript parser and checks that the extraction core
  reads each one through an extractor receiver. On main it fails, listing
  extractVariables; with the fix both tests pass, and all 59 remaining
  members are read.
- The compiled JavaScript is byte-identical: of 1,164 dist files hashed, only
  tree-sitter-types.d.ts and its map changed.
- expressjs/express (0dee2c52, 214 files) indexed before and after, on the
  native-kernel and the wasm paths: the graph dumps are byte-identical
  (12,450 lines; 1,135 nodes, 2,258 edges).

Fixes #2465

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 17:23:05 +00:00
..