#[derive(Debug, Clone)]
pub struct SemanticData {
pub project_root: String,
pub documents: Vec<DocumentData>,
pub external_symbols: Vec<SymbolMetadata>, }
#[derive(Debug, Clone)]
pub struct DocumentData {
pub relative_path: String, pub language: String, pub definitions: Vec<Definition>, pub references: Vec<Reference>, }
#[derive(Debug, Clone)]
pub struct Definition {
pub symbol: String, pub range: SourceRange, pub enclosing_range: SourceRange, pub metadata: SymbolMetadata, }
#[derive(Debug, Clone)]
pub struct Reference {
pub symbol: String, pub range: SourceRange, pub enclosing_symbol: String, pub role: ReferenceRole, }
#[derive(Debug, Clone)]
pub struct SymbolMetadata {
pub symbol: String, pub kind: SymbolKind, pub display_name: String, pub documentation: Vec<String>, pub signature: Option<String>, pub relationships: Vec<Relationship>, pub enclosing_symbol: Option<String>, pub is_external: bool, }
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct SourceRange {
pub start_line: u32,
pub start_column: u32,
pub end_line: u32,
pub end_column: u32,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ReferenceRole {
Read, Write, Call, Import, TypeUsage, Unknown,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum SymbolKind {
Function,
Method,
Constructor,
StaticMethod,
AbstractMethod,
Class,
Interface,
Struct,
Enum,
TypeAlias,
Trait, Protocol,
Variable,
Field,
Constant,
Parameter,
Namespace,
Module,
Package,
Macro,
Unknown,
}
#[derive(Debug, Clone)]
pub struct Relationship {
pub target_symbol: String,
pub kind: RelationshipKind,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum RelationshipKind {
Implements, Inherits, References, TypeDefinition, }