From de1c8e60f190de2b861c0cb066130fe7b5f82186 Mon Sep 17 00:00:00 2001 From: carlos-alm <127798846+carlos-alm@users.noreply.github.com> Date: Mon, 23 Mar 2026 03:18:49 -0600 Subject: [PATCH 1/3] feat(native): extract base_list for C# classes (closes #574) tree-sitter-c-sharp exposes base_list as a child node type, not a named field. The native engine was only trying child_by_field_name("bases"), which always returned None. Add find_child fallback to locate the base_list node by kind, matching the WASM extractor's approach. Re-enable the skipped C# parity test. --- crates/codegraph-core/src/extractors/csharp.rs | 6 +++++- tests/engines/parity.test.js | 2 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/codegraph-core/src/extractors/csharp.rs b/crates/codegraph-core/src/extractors/csharp.rs index e2243c2f..529e6026 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, diff --git a/tests/engines/parity.test.js b/tests/engines/parity.test.js index 804e40e5..7acf9c21 100644 --- a/tests/engines/parity.test.js +++ b/tests/engines/parity.test.js @@ -226,8 +226,6 @@ 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: true, code: ` using System; using System.Collections.Generic; From 3eafbe0f000146c74545f102447ec6569cb5a482 Mon Sep 17 00:00:00 2001 From: carlos-alm <127798846+carlos-alm@users.noreply.github.com> Date: Mon, 23 Mar 2026 04:13:12 -0600 Subject: [PATCH 2/3] fix(test): re-skip C# parity test until native binary release (#577) CI tests use pre-built native binaries from npm, which don't have the base_list extraction fix yet. Re-skip until next release. --- tests/engines/parity.test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/engines/parity.test.js b/tests/engines/parity.test.js index 7acf9c21..ef966af3 100644 --- a/tests/engines/parity.test.js +++ b/tests/engines/parity.test.js @@ -226,6 +226,8 @@ class Document implements Printable { { name: 'C# — classes and using', file: 'Test.cs', + // Skip until next native binary release includes base_list extraction fix + skip: true, code: ` using System; using System.Collections.Generic; From 7cae09b669390fba1b97ddeca89b2cf7a03720cc Mon Sep 17 00:00:00 2001 From: carlos-alm <127798846+carlos-alm@users.noreply.github.com> Date: Mon, 23 Mar 2026 04:13:25 -0600 Subject: [PATCH 3/3] refactor(native): remove unreachable base_list match arm (#577) With find_child returning the base_list node directly, its children are type-level nodes (identifier, qualified_name, etc.) that never match "base_list" again. Remove the dead arm. Impact: 1 functions changed, 3 affected --- .../codegraph-core/src/extractors/csharp.rs | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/crates/codegraph-core/src/extractors/csharp.rs b/crates/codegraph-core/src/extractors/csharp.rs index 529e6026..9da63d97 100644 --- a/crates/codegraph-core/src/extractors/csharp.rs +++ b/crates/codegraph-core/src/extractors/csharp.rs @@ -437,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), - }); - } - } - _ => {} - } - } - } - } _ => {} } }