mirror of
https://github.com/colbymchenry/codegraph.git
synced 2026-10-21 08:47:04 +08:00
fix(ts): index abstract methods as methods of their class (#2653)
Neither the TS extractor nor the kernel read `abstract_method_signature`, so an abstract class's `abstract send(path: string): Promise<unknown>;` had no node. An abstract class used as a dependency-injection token, like bitwarden's `abstract class ApiService` in `libs/common/src/abstractions`, had none of its methods in the graph, and a call through a field of that type linked to whichever same-named class declared the method. Abstract methods are now indexed as method signatures are: a method of the class that declares them, never a free function. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -51,7 +51,7 @@ impl Variant {
|
||||
/// typescriptExtractor.methodTypes / javascriptExtractor.methodTypes.
|
||||
fn is_method_type(v: Variant, kind: &str) -> bool {
|
||||
kind == "method_definition"
|
||||
|| (v.is_ts() && matches!(kind, "public_field_definition" | "method_signature"))
|
||||
|| (v.is_ts() && matches!(kind, "public_field_definition" | "method_signature" | "abstract_method_signature"))
|
||||
|| (!v.is_ts() && kind == "field_definition")
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ fn is_property_type(v: Variant, kind: &str) -> bool {
|
||||
/// `function stop` beside the real `Handle::stop`. Mirrors the TS extractor's
|
||||
/// SIGNATURE_METHOD_NODE_TYPES (extraction/tree-sitter.ts).
|
||||
fn is_signature_method_type(kind: &str) -> bool {
|
||||
kind == "method_signature"
|
||||
matches!(kind, "method_signature" | "abstract_method_signature")
|
||||
}
|
||||
|
||||
fn is_function_type(kind: &str) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user