Skip to content

Commit 970ddf2

Browse files
Merge #7806
7806: Fixed remaining references to `AnalysisChange` (now: `Change`) r=matklad a=regexident (The type was renamed/moved in 8716c4c) Co-authored-by: Vincent Esche <[email protected]>
2 parents 7ed2da6 + c4e2f32 commit 970ddf2

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

crates/base_db/src/change.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub struct Change {
1919

2020
impl fmt::Debug for Change {
2121
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
22-
let mut d = fmt.debug_struct("AnalysisChange");
22+
let mut d = fmt.debug_struct("Change");
2323
if let Some(roots) = &self.roots {
2424
d.field("roots", roots);
2525
}

crates/ide_db/src/apply_change.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct RootChange {
3232

3333
impl fmt::Debug for RootChange {
3434
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
35-
fmt.debug_struct("AnalysisChange")
35+
fmt.debug_struct("RootChange")
3636
.field("added", &self.added.len())
3737
.field("removed", &self.removed.len())
3838
.finish()

crates/ide_db/src/source_change.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! This modules defines type to represent changes to the source code, that flow
22
//! from the server to the client.
33
//!
4-
//! It can be viewed as a dual for `AnalysisChange`.
4+
//! It can be viewed as a dual for `Change`.
55
66
use std::{
77
collections::hash_map::Entry,

docs/dev/guide.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ Next, let's talk about what the inputs to the `Analysis` are, precisely.
6565

6666
Rust Analyzer never does any I/O itself, all inputs get passed explicitly via
6767
the `AnalysisHost::apply_change` method, which accepts a single argument, a
68-
`AnalysisChange`. [`AnalysisChange`] is a builder for a single change
68+
`Change`. [`Change`] is a builder for a single change
6969
"transaction", so it suffices to study its methods to understand all of the
7070
input data.
7171

72-
[`AnalysisChange`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/lib.rs#L119-L167
72+
[`Change`]: https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/base_db/src/change.rs#L14-L89
7373

7474
The `(add|change|remove)_file` methods control the set of the input files, where
7575
each file has an integer id (`FileId`, picked by the client), text (`String`)
@@ -158,7 +158,7 @@ it should be possible to dynamically reconfigure it later without restart.
158158
[main_loop.rs#L62-L70](https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L62-L70)
159159

160160
The [`ProjectModel`] we get after this step is very Cargo and sysroot specific,
161-
it needs to be lowered to get the input in the form of `AnalysisChange`. This
161+
it needs to be lowered to get the input in the form of `Change`. This
162162
happens in [`ServerWorldState::new`] method. Specifically
163163

164164
* Create a `SourceRoot` for each Cargo package and sysroot.
@@ -175,7 +175,7 @@ of the main loop, just like any other change. Here's where we handle:
175175
* [File system changes](https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L194)
176176
* [Changes from the editor](https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L377)
177177

178-
After a single loop's turn, we group the changes into one `AnalysisChange` and
178+
After a single loop's turn, we group the changes into one `Change` and
179179
[apply] it. This always happens on the main thread and blocks the loop.
180180

181181
[apply]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/server_world.rs#L216
@@ -256,7 +256,7 @@ database.
256256
[`RootDatabase`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/db.rs#L88-L134
257257

258258
Salsa input queries are defined in [`FilesDatabase`] (which is a part of
259-
`RootDatabase`). They closely mirror the familiar `AnalysisChange` structure:
259+
`RootDatabase`). They closely mirror the familiar `Change` structure:
260260
indeed, what `apply_change` does is it sets the values of input queries.
261261

262262
[`FilesDatabase`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/base_db/src/input.rs#L150-L174

0 commit comments

Comments
 (0)