Skip to content

Commit c0f1738

Browse files
committed
Re-implement dependecny tracking for cargo script
1 parent d4ff924 commit c0f1738

File tree

11 files changed

+188
-234
lines changed

11 files changed

+188
-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
@@ -287,8 +287,10 @@ impl CargoWorkspace {
287287
.collect(),
288288
);
289289
}
290-
if cargo_toml.extension().is_some_and(|x| x == "rs") {
291-
// TODO: enable `+nightly` for cargo scripts
290+
// The manifest is a rust file, so this means its a script manifest
291+
if cargo_toml.extension().is_some_and(|ext| ext == "rs") {
292+
// Deliberately don't set up RUSTC_BOOTSTRAP or a nightly override here, the user should
293+
// opt into it themselves.
292294
other_options.push("-Zscript".to_owned());
293295
}
294296
meta.other_options(other_options);

crates/project-model/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub use crate::{
5050
manifest_path::ManifestPath,
5151
project_json::{ProjectJson, ProjectJsonData},
5252
sysroot::Sysroot,
53-
workspace::{CargoScriptTomls, CfgOverrides, PackageRoot, ProjectWorkspace},
53+
workspace::{CfgOverrides, PackageRoot, ProjectWorkspace},
5454
};
5555

5656
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd)]

0 commit comments

Comments
 (0)