Skip to main content

find_declaration_cross_file

Function find_declaration_cross_file 

Source
pub fn find_declaration_cross_file(
    files: &HashMap<PathBuf, String>,
    current_path: &Path,
    name: &str,
) -> Option<CrossFileSymbol>
Expand description

Find name’s declaration in any project file other than current_path. Content-ownership track (#1086) slice 1: files is a pre-read (path, content) map (the caller’s overlay-then-disk sweep) rather than bare paths this function used to read from disk itself. Returns the first hit, in path-sorted order (see sorted_paths); None if the name is not found anywhere in the project.

Caller is responsible for trying the open file’s local symbol table first; this function intentionally skips current_path so the local path remains the fast path.