pub trait ModuleResolver: Send + Sync {
// Required methods
fn resolve_import(
&self,
module_path: &str,
from_file: &Path,
base_dir: &Path,
) -> Result<ResolvedPath, ContextCreatorError>;
fn get_file_extensions(&self) -> Vec<&'static str>;
// Provided method
fn is_external_module(&self, module_path: &str) -> bool { ... }
}Expand description
Trait for language-specific module resolution
Required Methods§
Sourcefn resolve_import(
&self,
module_path: &str,
from_file: &Path,
base_dir: &Path,
) -> Result<ResolvedPath, ContextCreatorError>
fn resolve_import( &self, module_path: &str, from_file: &Path, base_dir: &Path, ) -> Result<ResolvedPath, ContextCreatorError>
Resolve a module import to a file path
Sourcefn get_file_extensions(&self) -> Vec<&'static str>
fn get_file_extensions(&self) -> Vec<&'static str>
Get common file extensions for this language
Provided Methods§
Sourcefn is_external_module(&self, module_path: &str) -> bool
fn is_external_module(&self, module_path: &str) -> bool
Check if a module is likely external/third-party