Skip to content

Commit b17f1ee

Browse files
committed
Apply changes, fix path information in a comment in config.rs
1 parent 5e6f5b1 commit b17f1ee

File tree

3 files changed

+4
-19
lines changed

3 files changed

+4
-19
lines changed

crates/rust-analyzer/src/config.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,10 @@ mod patch_old_style;
6262
// To deprecate an option by replacing it with another name use `new_name | `old_name` so that we keep
6363
// parsing the old name.
6464
config_data! {
65-
/// Configs that apply on a workspace-wide scope. There are 3 levels on which a global configuration can be configured
66-
// FIXME: 1. and 3. should be split, some configs do not make sense per project
65+
/// Configs that apply on a workspace-wide scope. There are 2 levels on which a global configuration can be configured
6766
///
68-
/// 1. `rust-analyzer.toml` file under user's config directory (e.g ~/.config/rust-analyzer.toml)
67+
/// 1. `rust-analyzer.toml` file under user's config directory (e.g ~/.config/rust-analyzer/rust-analyzer.toml)
6968
/// 2. Client's own configurations (e.g `settings.json` on VS Code)
70-
/// 3. `rust-analyzer.toml` file located at the workspace root
7169
///
7270
/// A config is searched for by traversing a "config tree" in a bottom up fashion. It is chosen by the nearest first principle.
7371
global: struct GlobalDefaultConfigData <- GlobalConfigInput -> {
@@ -532,7 +530,7 @@ config_data! {
532530
cargo_allTargets: bool = true,
533531
/// Automatically refresh project info via `cargo metadata` on
534532
/// `Cargo.toml` or `.cargo/config.toml` changes.
535-
pub(crate) cargo_autoreload: bool = true,
533+
cargo_autoreload: bool = true,
536534
/// Run build scripts (`build.rs`) for more precise code analysis.
537535
cargo_buildScripts_enable: bool = true,
538536
/// Specifies the invocation strategy to use when running the build scripts command.

crates/rust-analyzer/src/handlers/notification.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,10 @@ pub(crate) fn handle_did_save_text_document(
145145
state: &mut GlobalState,
146146
params: DidSaveTextDocumentParams,
147147
) -> anyhow::Result<()> {
148-
let mut deps_change_processed = false;
149-
150148
if let Ok(vfs_path) = from_proto::vfs_path(&params.text_document.uri) {
151149
let snap = state.snapshot();
152150
let file_id = snap.vfs_path_to_file_id(&vfs_path)?;
153151
let sr = snap.analysis.source_root_id(file_id)?;
154-
deps_change_processed = true;
155152

156153
if state.config.script_rebuild_on_save(Some(sr)) && state.build_deps_changed {
157154
state.build_deps_changed = false;
@@ -199,16 +196,6 @@ pub(crate) fn handle_did_save_text_document(
199196
}
200197
}
201198

202-
if !deps_change_processed
203-
&& state.config.script_rebuild_on_save(None)
204-
&& state.build_deps_changed
205-
{
206-
state.build_deps_changed = false;
207-
state
208-
.fetch_build_data_queue
209-
.request_op("build_deps_changed - save notification".to_owned(), ());
210-
}
211-
212199
Ok(())
213200
}
214201

crates/rust-analyzer/src/reload.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ impl GlobalState {
122122
};
123123
let mut message = String::new();
124124

125-
if !self.config.cargo_autoreload(None)
125+
if !self.config.cargo_autoreload_config(None)
126126
&& self.is_quiescent()
127127
&& self.fetch_workspaces_queue.op_requested()
128128
&& self.config.discover_workspace_config().is_none()

0 commit comments

Comments
 (0)