mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Improve documentation for InvocationStrategy
This commit is contained in:
parent
0c395dc5a4
commit
3c4cdbbd1a
5 changed files with 29 additions and 23 deletions
|
@ -82,17 +82,16 @@ impl WorkspaceBuildScripts {
|
|||
config: &CargoConfig,
|
||||
workspaces: &[&CargoWorkspace],
|
||||
progress: &dyn Fn(String),
|
||||
workspace_root: &AbsPathBuf,
|
||||
working_directory: &AbsPathBuf,
|
||||
) -> io::Result<Vec<WorkspaceBuildScripts>> {
|
||||
assert_eq!(config.invocation_strategy, InvocationStrategy::Once);
|
||||
|
||||
let current_dir = workspace_root;
|
||||
let cmd = Self::build_command(
|
||||
config,
|
||||
&Default::default(),
|
||||
// This is not gonna be used anyways, so just construct a dummy here
|
||||
&ManifestPath::try_from(workspace_root.clone()).unwrap(),
|
||||
current_dir,
|
||||
&ManifestPath::try_from(working_directory.clone()).unwrap(),
|
||||
working_directory,
|
||||
&Sysroot::empty(),
|
||||
)?;
|
||||
// NB: Cargo.toml could have been modified between `cargo metadata` and
|
||||
|
|
|
@ -459,7 +459,7 @@ impl ProjectWorkspace {
|
|||
workspaces: &[ProjectWorkspace],
|
||||
config: &CargoConfig,
|
||||
progress: &dyn Fn(String),
|
||||
workspace_root: &AbsPathBuf,
|
||||
working_directory: &AbsPathBuf,
|
||||
) -> Vec<anyhow::Result<WorkspaceBuildScripts>> {
|
||||
if matches!(config.invocation_strategy, InvocationStrategy::PerWorkspace)
|
||||
|| config.run_build_script_command.is_none()
|
||||
|
@ -474,13 +474,16 @@ impl ProjectWorkspace {
|
|||
_ => None,
|
||||
})
|
||||
.collect();
|
||||
let outputs =
|
||||
&mut match WorkspaceBuildScripts::run_once(config, &cargo_ws, progress, workspace_root)
|
||||
{
|
||||
Ok(it) => Ok(it.into_iter()),
|
||||
// io::Error is not Clone?
|
||||
Err(e) => Err(sync::Arc::new(e)),
|
||||
};
|
||||
let outputs = &mut match WorkspaceBuildScripts::run_once(
|
||||
config,
|
||||
&cargo_ws,
|
||||
progress,
|
||||
working_directory,
|
||||
) {
|
||||
Ok(it) => Ok(it.into_iter()),
|
||||
// io::Error is not Clone?
|
||||
Err(e) => Err(sync::Arc::new(e)),
|
||||
};
|
||||
|
||||
workspaces
|
||||
.iter()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue