Skip to main content

resolve_module_uri

Function resolve_module_uri 

Source
pub fn resolve_module_uri(
    module_name: &str,
    open_document_uris: &[String],
    workspace_folders: &[String],
    include_paths: &[String],
    use_system_inc: bool,
    system_inc: &[PathBuf],
    timeout: Duration,
) -> ModuleUriResolution
Expand description

Resolve a module name to a file:// URI using deterministic precedence.

Search order:

  1. Open document URIs (ends_with match on relative module path)
  2. Workspace folders + include_paths (path-safe filesystem checks)
  3. System @INC paths (when use_system_inc is true)

The search observes timeout and returns ModuleUriResolution::TimedOut if the budget is exhausted.