Skip to content

Commit 0b24599

Browse files
committed
Re-implement dependecny tracking for cargo script
1 parent 2f82807 commit 0b24599

File tree

10 files changed

+187
-234
lines changed

10 files changed

+187
-234
lines changed

crates/load-cargo/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ fn load_crate_graph(
335335
) -> RootDatabase {
336336
let (ProjectWorkspace::Cargo { toolchain, target_layout, .. }
337337
| ProjectWorkspace::Json { toolchain, target_layout, .. }
338-
| ProjectWorkspace::DetachedFiles { toolchain, target_layout, .. }) = ws;
338+
| ProjectWorkspace::DetachedFile { toolchain, target_layout, .. }) = ws;
339339

340340
let lru_cap = std::env::var("RA_LRU_CAP").ok().and_then(|it| it.parse::<usize>().ok());
341341
let mut db = RootDatabase::new(lru_cap);

crates/project-model/src/cargo_workspace.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,10 @@ impl CargoWorkspace {
305305
.collect(),
306306
);
307307
}
308-
if cargo_toml.extension().is_some_and(|x| x == "rs") {
309-
// TODO: enable `+nightly` for cargo scripts
308+
// The manifest is a rust file, so this means its a script manifest
309+
if cargo_toml.extension().is_some_and(|ext| ext == "rs") {
310+
// Deliberately don't set up RUSTC_BOOTSTRAP or a nightly override here, the user should
311+
// opt into it themselves.
310312
other_options.push("-Zscript".to_owned());
311313
}
312314
meta.other_options(other_options);

0 commit comments

Comments
 (0)