mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-04 11:34:51 +00:00

This wasn't a right decision in the first place, the feature flag was broken in the last rustfmt release, and syntax highlighting of imports is more important anyway
24 lines
623 B
Rust
24 lines
623 B
Rust
use std::path::PathBuf;
|
|
|
|
use thread_worker::Worker;
|
|
|
|
use crate::Result;
|
|
|
|
pub use ra_project_model::{
|
|
CargoWorkspace, Package, ProjectWorkspace, Sysroot, Target, TargetKind,
|
|
};
|
|
|
|
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()
|
|
},
|
|
)
|
|
}
|