Skip to main content

find_scope_by_path

Function find_scope_by_path 

Source
pub fn find_scope_by_path<'a>(
    scopes: &'a [Scope],
    current_dir: &Path,
) -> Option<&'a Scope>
Expand description

根据当前工作目录查找匹配的 scope。

按 dir 路径前缀最长匹配。例如当前在 src/cli/sub 时, cli scope(dir: src/cli)比 root scope(dir: .)优先级高。