Skip to content

feat(parse): Add C# AST extractor support#366

Merged
MaojiaSheng merged 1 commit intovolcengine:mainfrom
suraciii:feat/csharp-ast-extractor
Feb 28, 2026
Merged

feat(parse): Add C# AST extractor support#366
MaojiaSheng merged 1 commit intovolcengine:mainfrom
suraciii:feat/csharp-ast-extractor

Conversation

@suraciii
Copy link
Contributor

Summary

Add dedicated C# AST extractor support to the existing AST-based code skeleton extraction framework.

Changes Made

  • New: csharp.py - CSharpExtractor supporting classes, interfaces, structs, methods, properties, and XML documentation comments
  • Update: extractor.py - Register .cs extension and csharp extractor
  • Update: pyproject.toml - Add tree-sitter-c-sharp dependency
  • Update: test_ast_extractor.py - Add TestCSharpExtractor with 10 tests

Testing

  • Unit tests added (test_csharp_dispatch, TestCSharpExtractor)
  • Follows existing extractor patterns (Java, Go)
  • Handles: imports, classes, methods, properties, docstrings, to_text formatting

Related Issues

Related to #334 (feat: add AST-based code skeleton extraction mode)

- Add CSharpExtractor class with support for:
  - Classes, interfaces, structs, records
  - Methods, constructors, properties
  - XML documentation comments (/// and /** */)
  - Namespaces and file-scoped namespaces
  - using directives

- Register .cs file extension and csharp extractor
- Add tree-sitter-c-sharp dependency
- Add comprehensive tests aligned with other language extractors
@CLAassistant
Copy link

CLAassistant commented Feb 28, 2026

CLA assistant check
All committers have signed the CLA.

@MaojiaSheng MaojiaSheng merged commit dc5da23 into volcengine:main Feb 28, 2026
1 check passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenViking project Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants