Skip to main content

find_package_roots

Function find_package_roots 

Source
pub fn find_package_roots(project_root: &Path) -> Vec<(Language, PathBuf)>
Expand description

Find all LSP workspace roots within a project for monorepo support.

Recursively walks the entire project tree (respecting .gitignore) to find all manifest files. Each manifest’s parent directory becomes a workspace candidate. De-nests: if a parent directory already has the same language marker, child directories are skipped (e.g., Rust workspace crates don’t each get their own LSP root — the workspace root covers them).

Returns (Language, PathBuf) pairs sorted by path depth (shallowest first).