Skip to content

Commit 76c2316

Browse files
committed
compile rust-anaylzer with x check if it's enabled
By default, `x check` doesn't compile the rust-analyzer. But when it's enabled in the config's tools section, there's no reason not to do it. This change allows `x check` to compile rust-analyzer if it's enabled in config's tools section. Signed-off-by: ozkanonur <[email protected]>
1 parent a1e1dba commit 76c2316

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/bootstrap/check.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,17 @@ pub struct RustAnalyzer {
353353
impl Step for RustAnalyzer {
354354
type Output = ();
355355
const ONLY_HOSTS: bool = true;
356-
const DEFAULT: bool = false;
356+
const DEFAULT: bool = true;
357357

358358
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
359-
run.path("src/tools/rust-analyzer")
359+
let builder = run.builder;
360+
run.path("src/tools/rust-analyzer").default_condition(
361+
builder
362+
.config
363+
.tools
364+
.as_ref()
365+
.map_or(true, |tools| tools.iter().any(|tool| tool == "rust-analyzer")),
366+
)
360367
}
361368

362369
fn make_run(run: RunConfig<'_>) {

0 commit comments

Comments
 (0)