pub trait ProjectResolutionEnhancer: Send + Sync {
// Required method
fn enhance_import_path(
&self,
import_path: &str,
from_file: FileId,
) -> Option<String>;
// Provided method
fn get_import_candidates(
&self,
import_path: &str,
from_file: FileId,
) -> Vec<String> { ... }
}Expand description
Project-specific resolution enhancement
This trait allows languages to enhance their import resolution with project configuration (tsconfig.json, pyproject.toml, go.mod, etc.)
Required Methods§
Sourcefn enhance_import_path(
&self,
import_path: &str,
from_file: FileId,
) -> Option<String>
fn enhance_import_path( &self, import_path: &str, from_file: FileId, ) -> Option<String>
Transform an import path using project-specific rules
Returns None if no transformation is needed (use original path) Returns Some(enhanced_path) if the import should be resolved differently
§Examples
- TypeScript: “@app/utils” -> “src/app/utils”
- Python: “.utils” -> “mypackage.submodule.utils”
- Go: “old/pkg” -> “../new/pkg”
- PHP: “App\Utils” -> “src/Utils.php”