| Crates.io | codegraph-kotlin |
| lib.rs | codegraph-kotlin |
| version | 0.1.0 |
| created_at | 2026-01-18 08:48:20.035602+00 |
| updated_at | 2026-01-18 08:48:20.035602+00 |
| description | Kotlin parser for CodeGraph - extracts code entities and relationships from Kotlin source files |
| homepage | |
| repository | https://github.com/anvanster/codegraph |
| max_upload_size | |
| id | 2052067 |
| size | 117,575 |
Kotlin parser for CodeGraph - extracts code entities and relationships from Kotlin source files.
use codegraph_kotlin::KotlinParser;
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 = KotlinParser::new();
let file_info = parser.parse_file(Path::new("Main.kt"), &mut graph)?;
println!("Parsed {} functions", file_info.functions.len());
println!("Parsed {} classes", file_info.classes.len());
Ok(())
}
| Kotlin Construct | Maps To |
|---|---|
class |
ClassEntity |
interface |
TraitEntity |
object |
ClassEntity (with "object" attribute) |
data class |
ClassEntity (with "data" attribute) |
enum class |
ClassEntity (with "enum" attribute) |
sealed class |
ClassEntity (with "sealed" attribute) |
fun |
FunctionEntity |
suspend fun |
FunctionEntity (with is_async=true) |
package |
Used for qualified names |
import |
ImportRelation |
: (inheritance) |
InheritanceRelation / ImplementationRelation |
Apache-2.0