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:
Colby Mchenry
2026-10-19 09:16:52 +00:00
committed by GitHub
parent de3eb71df6
commit c7b50382af
5 changed files with 91 additions and 5 deletions
+2 -2
View File
@@ -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 {