X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Ftools%2Frust-analyzer%2Fcrates%2Fproject-model%2Fsrc%2Flib.rs;h=575581fa543a309495a5c3806d26703d03bf1298;hb=22a6bc4da0ce15606e3a7fb01c5cc6ff175f79af;hp=ce78ce85697afd23170359c5ebf572ca69a93e5a;hpb=66de34b0352146994b76e6399dd5cd5abc3ae3ce;p=rust.git diff --git a/src/tools/rust-analyzer/crates/project-model/src/lib.rs b/src/tools/rust-analyzer/crates/project-model/src/lib.rs index ce78ce85697..575581fa543 100644 --- a/src/tools/rust-analyzer/crates/project-model/src/lib.rs +++ b/src/tools/rust-analyzer/crates/project-model/src/lib.rs @@ -67,7 +67,7 @@ pub fn from_manifest_file(path: AbsPathBuf) -> Result { if path.file_name().unwrap_or_default() == "Cargo.toml" { return Ok(ProjectManifest::CargoToml(path)); } - bail!("project root must point to Cargo.toml or rust-project.json: {}", path.display()) + bail!("project root must point to Cargo.toml or rust-project.json: {}", path.display()); } pub fn discover_single(path: &AbsPath) -> Result { @@ -78,7 +78,7 @@ pub fn discover_single(path: &AbsPath) -> Result { }; if !candidates.is_empty() { - bail!("more than one project") + bail!("more than one project"); } Ok(res) } @@ -157,3 +157,17 @@ fn utf8_stdout(mut cmd: Command) -> Result { let stdout = String::from_utf8(output.stdout)?; Ok(stdout.trim().to_string()) } + +#[derive(Copy, Clone, Debug, Default, PartialEq, Eq)] +pub enum InvocationStrategy { + Once, + #[default] + PerWorkspace, +} + +#[derive(Clone, Debug, Default, PartialEq, Eq)] +pub enum InvocationLocation { + Root(AbsPathBuf), + #[default] + Workspace, +}