C# tree-sitter parser #1

Open
opened 2026-06-16 14:47:11 +00:00 by GKaszewski · 0 comments
Owner

What to build

Add C# source code analysis using tree-sitter. Implement the LanguageExtractor trait for C# inside the tree-sitter adapter crate. Extract classes, interfaces, structs, enums, inheritance, composition (fields + constructor params), and using statements as import relationships. Filter out .NET framework types (string, int, List, etc.) the same way Rust and Python filter primitives.

The Language::CSharp variant and .cs file detection already exist — this slice fills in the stubbed-out empty result.

Acceptance criteria

  • CSharpExtractor implements LanguageExtractor trait
  • Extracts classes, interfaces, structs, enums with correct CodeElementKind
  • Detects inheritance (class Foo : Bar) and composition (fields, constructor params)
  • Tracks using statements as Import relationships, filters framework/external imports
  • Tests with real C# source snippets covering all patterns
  • Existing tests still pass

Blocked by

None - can start immediately

## What to build Add C# source code analysis using tree-sitter. Implement the `LanguageExtractor` trait for C# inside the tree-sitter adapter crate. Extract classes, interfaces, structs, enums, inheritance, composition (fields + constructor params), and `using` statements as import relationships. Filter out .NET framework types (string, int, List, etc.) the same way Rust and Python filter primitives. The `Language::CSharp` variant and `.cs` file detection already exist — this slice fills in the stubbed-out empty result. ## Acceptance criteria - [ ] `CSharpExtractor` implements `LanguageExtractor` trait - [ ] Extracts classes, interfaces, structs, enums with correct `CodeElementKind` - [ ] Detects inheritance (`class Foo : Bar`) and composition (fields, constructor params) - [ ] Tracks `using` statements as `Import` relationships, filters framework/external imports - [ ] Tests with real C# source snippets covering all patterns - [ ] Existing tests still pass ## Blocked by None - can start immediately
GKaszewski added the P3 label 2026-06-17 06:46:18 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GKaszewski/archlens#1