Skip to main content

resolve_unified

Function resolve_unified 

Source
pub fn resolve_unified(
    query: &str,
    root: &Path,
    alias_lookup: &dyn Fn(&str) -> Option<Vec<String>>,
    path_source: Option<&dyn PathSource>,
) -> Option<UnifiedPath>
Expand description

Resolve a unified path like src/main.py/Foo/bar to file + symbol components.

Uses filesystem as source of truth: walks segments left-to-right, checking at each step whether the path exists as file or directory. Once we hit a file, remaining segments are the symbol path.

Strategy:

  1. Walk path segments, checking each accumulated path against filesystem
  2. When we hit a file, everything after is symbol path
  3. If exact path doesn’t exist, try fuzzy matching for the file portion