Auto merge of #12093 - nico-abram:uwu, r=Veykril

Reload project on .cargo/config[.toml] changes

Fixes #11024

Not adding tests as discussed in the issue
This commit is contained in:
bors 2022-05-02 12:21:42 +00:00
commit 9e10d4b717
4 changed files with 8 additions and 3 deletions

View File

@ -67,7 +67,7 @@ struct ConfigData {
callInfo_full: bool = "true",
/// Automatically refresh project info via `cargo metadata` on
/// `Cargo.toml` changes.
/// `Cargo.toml` or `.cargo/config.toml` changes.
cargo_autoreload: bool = "true",
/// Activate all available features (`--all-features`).
cargo_allFeatures: bool = "false",

View File

@ -617,6 +617,11 @@ pub(crate) fn should_refresh_for_change(path: &AbsPath, change_kind: ChangeKind)
return false;
}
if path.extension().unwrap_or_default() != "rs" {
if (file_name == "config.toml" || file_name == "config")
&& path.parent().map(|parent| parent.as_ref().ends_with(".cargo")) == Some(true)
{
return true;
}
return false;
}
if IMPLICIT_TARGET_FILES.iter().any(|it| path.as_ref().ends_with(it)) {

View File

@ -42,7 +42,7 @@ Show function name and docs in parameter hints.
+
--
Automatically refresh project info via `cargo metadata` on
`Cargo.toml` changes.
`Cargo.toml` or `.cargo/config.toml` changes.
--
[[rust-analyzer.cargo.allFeatures]]rust-analyzer.cargo.allFeatures (default: `false`)::
+

View File

@ -439,7 +439,7 @@
"type": "boolean"
},
"rust-analyzer.cargo.autoreload": {
"markdownDescription": "Automatically refresh project info via `cargo metadata` on\n`Cargo.toml` changes.",
"markdownDescription": "Automatically refresh project info via `cargo metadata` on\n`Cargo.toml` or `.cargo/config.toml` changes.",
"default": true,
"type": "boolean"
},