mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
chore(config): remove invocationLocation
in favor of invocationStrategy
These flags were added to help rust-analyzer integrate with repos requiring non-Cargo invocations. The consensus is that having two independent settings are no longer needed. This change removes `invocationLocation` in favor of `invocationStrategy` and changes the internal representation of `InvocationStrategy::Once` to hold the workspace root.
This commit is contained in:
parent
fa00326247
commit
b0f20c7deb
8 changed files with 33 additions and 173 deletions
|
@ -19,8 +19,8 @@ use serde::Deserialize;
|
|||
use toolchain::Tool;
|
||||
|
||||
use crate::{
|
||||
utf8_stdout, CargoConfig, CargoFeatures, CargoWorkspace, InvocationLocation,
|
||||
InvocationStrategy, ManifestPath, Package, Sysroot, TargetKind,
|
||||
utf8_stdout, CargoConfig, CargoFeatures, CargoWorkspace, InvocationStrategy, ManifestPath,
|
||||
Package, Sysroot, TargetKind,
|
||||
};
|
||||
|
||||
/// Output of the build script and proc-macro building steps for a workspace.
|
||||
|
@ -63,10 +63,7 @@ impl WorkspaceBuildScripts {
|
|||
progress: &dyn Fn(String),
|
||||
sysroot: &Sysroot,
|
||||
) -> io::Result<WorkspaceBuildScripts> {
|
||||
let current_dir = match &config.invocation_location {
|
||||
InvocationLocation::Root(root) if config.run_build_script_command.is_some() => root,
|
||||
_ => workspace.workspace_root(),
|
||||
};
|
||||
let current_dir = workspace.workspace_root();
|
||||
|
||||
let allowed_features = workspace.workspace_features();
|
||||
let cmd = Self::build_command(
|
||||
|
@ -89,15 +86,7 @@ impl WorkspaceBuildScripts {
|
|||
) -> io::Result<Vec<WorkspaceBuildScripts>> {
|
||||
assert_eq!(config.invocation_strategy, InvocationStrategy::Once);
|
||||
|
||||
let current_dir = match &config.invocation_location {
|
||||
InvocationLocation::Root(root) => root,
|
||||
InvocationLocation::Workspace => {
|
||||
return Err(io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
"Cannot run build scripts from workspace with invocation strategy `once`",
|
||||
))
|
||||
}
|
||||
};
|
||||
let current_dir = workspace_root;
|
||||
let cmd = Self::build_command(
|
||||
config,
|
||||
&Default::default(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue