Skip to content

Commit 52f7575

Browse files
committed
minor: chore: fix typos and urls in docs/dev/guide.md
1 parent 3ab1666 commit 52f7575

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

docs/dev/guide.md

+12-13
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-
`Change`. [`Change`] is a builder for a single change
68+
`AnalysisChange`. [`AnalysisChange`] 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-
[`Change`]: https://github.com/rust-lang/rust-analyzer/blob/master/crates/base_db/src/change.rs#L14-L89
72+
[`AnalysisChange`]: https://github.com/rust-lang/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/lib.rs#L119-L167
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`)
@@ -118,7 +118,7 @@ can have `#[path="/dev/random"] mod foo;`.
118118

119119
To solve (or explicitly refuse to solve) these problems rust-analyzer uses the
120120
concept of a "source root". Roughly speaking, source roots are the contents of a
121-
directory on a file systems, like `/home/matklad/projects/rustraytracer/**.rs`.
121+
directory on a file system, like `/home/matklad/projects/rustraytracer/**.rs`.
122122

123123
More precisely, all files (`FileId`s) are partitioned into disjoint
124124
`SourceRoot`s. Each file has a relative UTF-8 path within the `SourceRoot`.
@@ -156,7 +156,7 @@ it should be possible to dynamically reconfigure it later without restart.
156156
[main_loop.rs#L62-L70](https://github.com/rust-lang/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L62-L70)
157157

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

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

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

179179
[apply]: https://github.com/rust-lang/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/server_world.rs#L216
@@ -186,7 +186,7 @@ executing "goto definition" on the threadpool and a new change comes in, the
186186
task will be canceled as soon as the main loop calls `apply_change` on the
187187
`AnalysisHost`.
188188

189-
["goto definition"]: https://github.com/rust-lang/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/server_world.rs#L216
189+
["goto definition"]: https://github.com/rust-lang/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L296
190190
[`schedule`]: https://github.com/rust-lang/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L426-L455
191191
[The task]: https://github.com/rust-lang/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop/handlers.rs#L205-L223
192192

@@ -250,13 +250,13 @@ All analyzer information is stored in a salsa database. `Analysis` and
250250
`AnalysisHost` types are newtype wrappers for [`RootDatabase`] -- a salsa
251251
database.
252252

253-
[`RootDatabase`]: https://github.com/rust-lang/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/db.rs#L88-L134
253+
[`RootDatabase`]: https://github.com/rust-lang/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/db.rs#L88-L134
254254

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

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

261261
## From text to semantic model
262262

@@ -281,7 +281,7 @@ methods invoke various queries on the database to build the model on demand.
281281
Here's [the list of queries].
282282

283283
[`code_model_api`]: https://github.com/rust-lang/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/code_model_api.rs
284-
[the list of queries]: https://github.com/rust-lang/rust-analyzer/blob/7e84440e25e19529e4ff8a66e521d1b06349c6ec/crates/ra_hir/src/db.rs#L20-L106
284+
[the list of queries]: https://github.com/rust-lang/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/db.rs#L20-L106
285285

286286
The first step of building the model is parsing the source code.
287287

@@ -493,7 +493,7 @@ position-independent part of the lowering. The result of this query is stable.
493493
Naturally, name resolution [uses] this stable projection query.
494494

495495
[imports]: https://github.com/rust-lang/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/nameres/lower.rs#L52-L59
496-
[`SourceMap`]: https://github.com/rust-lang/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/nameres/lower.rs#L52-L59
496+
[`SourceMap`]: https://github.com/rust-lang/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/nameres/lower.rs#L74-L94
497497
[projection query]: https://github.com/rust-lang/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/nameres/lower.rs#L97-L103
498498
[uses]: https://github.com/rust-lang/rust-analyzer/blob/guide-2019-01/crates/ra_hir/src/query_definitions.rs#L49
499499

@@ -560,8 +560,7 @@ the type to completion.
560560
[receiving a message]: https://github.com/rust-lang/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L203
561561
[schedule it on the threadpool]: https://github.com/rust-lang/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L428
562562
[catch]: https://github.com/rust-lang/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L436-L442
563-
[the handler]: https://salsa.zulipchat.com/#narrow/stream/181542-rfcs.2Fsalsa-query-group/topic/design.20next.20steps
564-
[ask analysis for completion]: https://github.com/rust-lang/rust-analyzer/blob/guide-2019-01/crates/ide_api/src/lib.rs#L439-L444
563+
[the handler]: https://github.com/rust-lang/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop/handlers.rs#L304-L343
565564
[ask analysis for completion]: https://github.com/rust-lang/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/lib.rs#L439-L444
566565
[completion implementation]: https://github.com/rust-lang/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion.rs#L46-L62
567566
[`CompletionContext`]: https://github.com/rust-lang/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion/completion_context.rs#L14-L37

0 commit comments

Comments
 (0)