Skip to main content

find_source_file

Function find_source_file 

Source
pub fn find_source_file<'db>(
    db: &'db dyn Database,
    ws: Workspace,
    uri_str: &str,
) -> Option<SourceFile<'db>>
Expand description

O(log N) lookup of a single SourceFile by URI string.

Workspace::files is kept sorted by URI (see DocumentStore::sync_workspace_files), so binary search gives the index in O(log N). workspace_files outputs in the same 1:1 order, so the same index addresses both slices.