mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-22 18:05:07 +00:00
bf352cd251
closes #817
23 lines
623 B
Rust
23 lines
623 B
Rust
use std::path::PathBuf;
|
|
|
|
use thread_worker::Worker;
|
|
|
|
use crate::Result;
|
|
|
|
pub use ra_project_model::{
|
|
ProjectWorkspace, CargoWorkspace, Package, Target, TargetKind, Sysroot,
|
|
};
|
|
|
|
pub fn workspace_loader() -> Worker<PathBuf, Result<ProjectWorkspace>> {
|
|
Worker::<PathBuf, Result<ProjectWorkspace>>::spawn(
|
|
"workspace loader",
|
|
1,
|
|
|input_receiver, output_sender| {
|
|
input_receiver
|
|
.into_iter()
|
|
.map(|path| ProjectWorkspace::discover(path.as_path()))
|
|
.try_for_each(|it| output_sender.send(it))
|
|
.unwrap()
|
|
},
|
|
)
|
|
}
|