Skip to main content

build_root_closure

Function build_root_closure 

Source
pub fn build_root_closure<F>(
    root: WorkspaceFile,
    workspace_root: Option<&Path>,
    preview_features: &PreviewFeatures,
    open_text: F,
) -> Vec<WorkspaceFile>
where F: FnMut(&Path) -> Option<String>,
Expand description

Build a (root + transitively-@import-reachable) WorkspaceFile set for one compilation root.

File text comes from open_text when the file is currently open in the editor, otherwise from disk. Already-visited paths are deduped so cyclic import graphs terminate.