fix(extraction): index TypeScript interface members (#1638) (#1780)

Land upstream #1686 (maxmilian + bompus kernel/CG-28 follow-ups)
onto current main. tree-sitter-typescript interface members
(method_signature / property_signature) were never listed in the
TS extractor, so platform .d.ts APIs had no declaration nodes for
call edges. Mirrors on the Rust kernel path; keeps CG-28 damping
for pure-interface declaration files; filters damped files from
the explore RWR seed set.

Co-authored-by: Colby McHenry <colbymchenry@users.noreply.github.com>
This commit is contained in:
Colby Mchenry
2026-09-08 11:27:05 -05:00
committed by GitHub
co-authored by Colby McHenry
parent 8c047342cd
commit ee83636acb
10 changed files with 375 additions and 49 deletions
+8 -1
View File
@@ -41,8 +41,15 @@ export function classifyTsClassMember(node: SyntaxNode): 'method' | 'property' {
export const typescriptExtractor: LanguageExtractor = {
functionTypes: ['function_declaration', 'generator_function_declaration', 'arrow_function', 'function_expression', 'generator_function'],
classTypes: ['class_declaration', 'abstract_class_declaration'],
methodTypes: ['method_definition', 'public_field_definition'],
// `method_signature` is the interface/type-literal form of a method; without it
// an interface's members never enter the graph, so a `.d.ts` platform API has
// no declaration node for call sites to attach to (#1638). Java/C# don't need
// an equivalent — their grammars reuse `method_declaration`.
methodTypes: ['method_definition', 'public_field_definition', 'method_signature'],
classifyMethodNode: classifyTsClassMember,
// The interface counterpart of `public_field_definition`. It carries no value,
// so it is always a property and never needs classifyMethodNode.
propertyTypes: ['property_signature'],
interfaceTypes: ['interface_declaration'],
structTypes: [],
enumTypes: ['enum_declaration'],