Context
PR implementing issue #1317 added prototype-based method extraction to the WASM JS extractor:
Foo.prototype.bar = function(){} → emits Foo.bar as a method definition
Foo.prototype.bar = identifier → seeds typeMap['Foo.bar'] = { type: identifier }
Foo.prototype = { bar: fn } → emits method definitions per property
The call resolver was also extended with:
- Prototype alias lookup: after symbol-DB miss for
TypeName.methodName, checks typeMap['TypeName.methodName']
- Inline
new Foo() receiver extraction: regex ^\(?\s*new\s+([A-Z_$]...) extracts the class name when receiver is (new Foo) or (new Foo())
What's missing in native
The Rust extractor (crates/codegraph-core/) does not implement any of the above. Until it does, WASM and native will produce different results for files containing prototype-based OOP patterns.
What needs to be done
- In the native Rust extractor, detect the three prototype assignment patterns and:
- Emit method definitions for function expressions
- Emit typeMap entries for identifier aliases
- In the native call resolver (or its WASM post-processing path), add the prototype alias lookup and inline new-expression receiver handling that were added to
call-resolver.ts
References
Context
PR implementing issue #1317 added prototype-based method extraction to the WASM JS extractor:
Foo.prototype.bar = function(){}→ emitsFoo.baras a method definitionFoo.prototype.bar = identifier→ seedstypeMap['Foo.bar'] = { type: identifier }Foo.prototype = { bar: fn }→ emits method definitions per propertyThe call resolver was also extended with:
TypeName.methodName, checkstypeMap['TypeName.methodName']new Foo()receiver extraction: regex^\(?\s*new\s+([A-Z_$]...)extracts the class name when receiver is(new Foo)or(new Foo())What's missing in native
The Rust extractor (
crates/codegraph-core/) does not implement any of the above. Until it does, WASM and native will produce different results for files containing prototype-based OOP patterns.What needs to be done
call-resolver.tsReferences
crates/codegraph-core/src/extractors/+ native build pipeline