diff --git a/crates/codegraph-core/src/extractors/csharp.rs b/crates/codegraph-core/src/extractors/csharp.rs index e2243c2f..9da63d97 100644 --- a/crates/codegraph-core/src/extractors/csharp.rs +++ b/crates/codegraph-core/src/extractors/csharp.rs @@ -403,7 +403,11 @@ fn extract_csharp_base_types( source: &[u8], symbols: &mut FileSymbols, ) { - let base_list = node.child_by_field_name("bases"); + // tree-sitter-c-sharp exposes base_list as a child node type, not a field, + // so child_by_field_name("bases") returns None — fall back to find_child. + let base_list = node + .child_by_field_name("bases") + .or_else(|| find_child(node, "base_list")); let base_list = match base_list { Some(bl) => bl, None => return, @@ -433,38 +437,6 @@ fn extract_csharp_base_types( }); } } - "base_list" => { - for j in 0..child.child_count() { - if let Some(base) = child.child(j) { - match base.kind() { - "identifier" | "qualified_name" => { - symbols.classes.push(ClassRelation { - name: class_name.to_string(), - extends: Some(node_text(&base, source).to_string()), - implements: None, - line: start_line(node), - }); - } - "generic_name" => { - let name = base - .child_by_field_name("name") - .or_else(|| base.child(0)); - if let Some(name) = name { - symbols.classes.push(ClassRelation { - name: class_name.to_string(), - extends: Some( - node_text(&name, source).to_string(), - ), - implements: None, - line: start_line(node), - }); - } - } - _ => {} - } - } - } - } _ => {} } } diff --git a/tests/engines/parity.test.js b/tests/engines/parity.test.js index 804e40e5..ef966af3 100644 --- a/tests/engines/parity.test.js +++ b/tests/engines/parity.test.js @@ -226,7 +226,7 @@ class Document implements Printable { { name: 'C# — classes and using', file: 'Test.cs', - // TODO: re-enable once native engine extracts base_list into classes array + // Skip until next native binary release includes base_list extraction fix skip: true, code: ` using System;