| Crates.io | codegraph-csharp |
| lib.rs | codegraph-csharp |
| version | 0.1.0 |
| created_at | 2026-01-18 08:48:27.144038+00 |
| updated_at | 2026-01-18 08:48:27.144038+00 |
| description | C# parser for CodeGraph - extracts code entities and relationships from C# source files |
| homepage | |
| repository | https://github.com/anvanster/codegraph |
| max_upload_size | |
| id | 2052068 |
| size | 122,600 |
C# parser for CodeGraph - extracts code entities and relationships from C# source files.
use codegraph_csharp::CSharpParser;
use codegraph_parser_api::CodeParser;
use codegraph::CodeGraph;
use std::path::Path;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut graph = CodeGraph::in_memory()?;
let parser = CSharpParser::new();
let file_info = parser.parse_file(Path::new("Program.cs"), &mut graph)?;
println!("Parsed {} methods", file_info.functions.len());
println!("Parsed {} classes", file_info.classes.len());
Ok(())
}
| C# Construct | Maps To |
|---|---|
class |
ClassEntity |
interface |
TraitEntity |
struct |
ClassEntity (with attribute) |
enum |
ClassEntity (with attribute) |
record |
ClassEntity (with attribute) |
method |
FunctionEntity |
constructor |
FunctionEntity |
using |
ImportRelation |
: (inheritance) |
InheritanceRelation |
: (implementation) |
ImplementationRelation |
Apache-2.0