pub struct CommandAnalyzer { /* private fields */ }Expand description
Analyzer that orchestrates all analysis sub-modules
Implementations§
Source§impl CommandAnalyzer
impl CommandAnalyzer
pub fn new() -> Self
Sourcepub fn add_type_mappings(&mut self, mappings: &HashMap<String, String>)
pub fn add_type_mappings(&mut self, mappings: &HashMap<String, String>)
Add custom type mappings from configuration
Sourcepub fn unresolved_types(&self) -> &[String]
pub fn unresolved_types(&self) -> &[String]
Type names referenced by commands/events that could not be resolved
in-project or via the external-crate lookup during the last
analyze_project* call. Empty when everything resolved (or when nothing
was analyzed yet).
These are the names whose absence used to be silently dropped (#77/#84); callers can log them, fail the build, or ignore them. The analyzer itself only warns and continues, to preserve backward-compatible output.
Sourcepub fn seed_external_type_cache(
&mut self,
index: HashMap<String, Option<PathBuf>>,
)
pub fn seed_external_type_cache( &mut self, index: HashMap<String, Option<PathBuf>>, )
Seed the external-crate lookup memo from a previous run’s persisted
index (loaded from .typecache). Seeded entries short-circuit the
registry walk for types already resolved last time (#87). The cache is
still filled for any type not present in the seed, so a partial/empty
seed is safe.
Sourcepub fn external_type_lookup_cache(&self) -> &HashMap<String, Option<PathBuf>>
pub fn external_type_lookup_cache(&self) -> &HashMap<String, Option<PathBuf>>
The current external-crate lookup memo (positive and negative results
accumulated during this analysis pass). Persisted into .typecache for
the next run via GenerationCache::new_with_external_index (#87).
Sourcepub fn analyze_project(
&mut self,
project_path: &str,
) -> Result<Vec<CommandInfo>, Box<dyn Error>>
pub fn analyze_project( &mut self, project_path: &str, ) -> Result<Vec<CommandInfo>, Box<dyn Error>>
Analyze a complete project for Tauri commands and types
Sourcepub fn analyze_project_with_verbose(
&mut self,
project_path: &str,
verbose: bool,
) -> Result<Vec<CommandInfo>, Box<dyn Error>>
pub fn analyze_project_with_verbose( &mut self, project_path: &str, verbose: bool, ) -> Result<Vec<CommandInfo>, Box<dyn Error>>
Analyze a complete project for Tauri commands and types with verbose output
Sourcepub fn analyze_file(
&mut self,
file_path: &Path,
) -> Result<Vec<CommandInfo>, Box<dyn Error>>
pub fn analyze_file( &mut self, file_path: &Path, ) -> Result<Vec<CommandInfo>, Box<dyn Error>>
Analyze a single file for Tauri commands (backward compatibility for tests)
Sourcepub fn extract_type_names(
&self,
rust_type: &str,
type_names: &mut HashSet<String>,
)
pub fn extract_type_names( &self, rust_type: &str, type_names: &mut HashSet<String>, )
Extract type names from a Rust type string
Sourcepub fn get_discovered_structs(&self) -> &HashMap<String, StructInfo>
pub fn get_discovered_structs(&self) -> &HashMap<String, StructInfo>
Get discovered structs
Sourcepub fn get_discovered_events(&self) -> &[EventInfo]
pub fn get_discovered_events(&self) -> &[EventInfo]
Get discovered events
Sourcepub fn get_type_resolver(&self) -> RefCell<&TypeResolver>
pub fn get_type_resolver(&self) -> RefCell<&TypeResolver>
Get reference to the type resolver
Sourcepub fn get_all_discovered_channels(
&self,
commands: &[CommandInfo],
) -> Vec<ChannelInfo>
pub fn get_all_discovered_channels( &self, commands: &[CommandInfo], ) -> Vec<ChannelInfo>
Get all discovered channels from all commands
Sourcepub fn get_dependency_graph(&self) -> &TypeDependencyGraph
pub fn get_dependency_graph(&self) -> &TypeDependencyGraph
Get the dependency graph for visualization
Sourcepub fn topological_sort_types(&self, types: &HashSet<String>) -> Vec<String>
pub fn topological_sort_types(&self, types: &HashSet<String>) -> Vec<String>
Sort types topologically to ensure dependencies are declared before being used
Sourcepub fn visualize_dependencies(&self, commands: &[CommandInfo]) -> String
pub fn visualize_dependencies(&self, commands: &[CommandInfo]) -> String
Generate a text-based visualization of the dependency graph
Sourcepub fn generate_dot_graph(&self, commands: &[CommandInfo]) -> String
pub fn generate_dot_graph(&self, commands: &[CommandInfo]) -> String
Generate a DOT graph visualization of the dependency graph