-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
internal: remove invocationLocation
in favor of invocationStrategy
#17888
Conversation
I changed both |
Right, looks like we don't need the variants to hold that info at all |
e169687
to
b5ae2c6
Compare
…ategy` 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.
b5ae2c6
to
b0f20c7
Compare
Thanks! |
☀️ Test successful - checks-actions |
invocationLocation
in favor of invocationStrategy
invocationLocation
in favor of invocationStrategy
/// - "root": run build scripts in the project's root directory. | ||
/// This config only has an effect when `#rust-analyzer.cargo.buildScripts.overrideCommand#` | ||
/// is set. | ||
cargo_buildScripts_invocationLocation: InvocationLocation = InvocationLocation::Workspace, | ||
/// Specifies the invocation strategy to use when running the build scripts command. | ||
/// If `per_workspace` is set, the command will be executed for each workspace. | ||
/// If `once` is set, the command will be executed once. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should document the working directory that the command will be executed in, for both cases.
@@ -3196,14 +3158,6 @@ fn field_props(field: &str, ty: &str, doc: &[&str], default: &str) -> serde_json | |||
"The command will be executed once." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be good to also mention the effect on the working directory here.
)) | ||
} | ||
}; | ||
let current_dir = workspace_root; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am surprised by this; once
should not be per-workspace... or does this refer to the vscode concept of a workspace rather than the cargo concent?
The argument list for this function is quite confusing since there are multiple "workspaces" but then just a single "workspace_root"...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable name here is a bit misleading (should be renamed into current_dir
/working_dir
, the sole caller of this passes the actual root here.
minor: Improve documentation for `InvocationStrategy` cc #17888
minor: Improve documentation for `InvocationStrategy` cc rust-lang/rust-analyzer#17888
…tings, r=jieyouxu Remove unncessary option for default rust-analyzer setting In favor of rust-lang/rust-analyzer#17888
…tings, r=jieyouxu Remove unncessary option for default rust-analyzer setting In favor of rust-lang/rust-analyzer#17888
…tings, r=jieyouxu Remove unncessary option for default rust-analyzer setting In favor of rust-lang/rust-analyzer#17888
Rollup merge of rust-lang#132438 - chenyukang:yukang-fix-analyzer_settings, r=jieyouxu Remove unncessary option for default rust-analyzer setting In favor of rust-lang/rust-analyzer#17888
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 ofinvocationStrategy
and changes the internal representation ofInvocationStrategy::Once
to hold the workspace root.Closes #17848.