diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/dev/README.md | 2 | ||||
-rw-r--r-- | docs/dev/architecture.md | 12 | ||||
-rw-r--r-- | docs/dev/guide.md | 24 |
3 files changed, 19 insertions, 19 deletions
diff --git a/docs/dev/README.md b/docs/dev/README.md index 0823ca09a..0f64d7e5f 100644 --- a/docs/dev/README.md +++ b/docs/dev/README.md | |||
@@ -14,7 +14,7 @@ To learn more about how rust-analyzer works, see | |||
14 | 14 | ||
15 | We also publish rustdoc docs to pages: | 15 | We also publish rustdoc docs to pages: |
16 | 16 | ||
17 | https://rust-analyzer.github.io/rust-analyzer/ra_ide_api/ | 17 | https://rust-analyzer.github.io/rust-analyzer/ra_ide/ |
18 | 18 | ||
19 | Various organizational and process issues are discussed in this document. | 19 | Various organizational and process issues are discussed in this document. |
20 | 20 | ||
diff --git a/docs/dev/architecture.md b/docs/dev/architecture.md index 6fd396dee..629645757 100644 --- a/docs/dev/architecture.md +++ b/docs/dev/architecture.md | |||
@@ -106,7 +106,7 @@ guessing a HIR for a particular source position. | |||
106 | 106 | ||
107 | Underneath, HIR works on top of salsa, using a `HirDatabase` trait. | 107 | Underneath, HIR works on top of salsa, using a `HirDatabase` trait. |
108 | 108 | ||
109 | ### `crates/ra_ide_api` | 109 | ### `crates/ra_ide` |
110 | 110 | ||
111 | A stateful library for analyzing many Rust files as they change. `AnalysisHost` | 111 | A stateful library for analyzing many Rust files as they change. `AnalysisHost` |
112 | is a mutable entity (clojure's atom) which holds the current state, incorporates | 112 | is a mutable entity (clojure's atom) which holds the current state, incorporates |
@@ -124,11 +124,11 @@ offsets and strings as output. This works on top of rich code model powered by | |||
124 | 124 | ||
125 | ### `crates/ra_lsp_server` | 125 | ### `crates/ra_lsp_server` |
126 | 126 | ||
127 | An LSP implementation which wraps `ra_ide_api` into a language server protocol. | 127 | An LSP implementation which wraps `ra_ide` into a language server protocol. |
128 | 128 | ||
129 | ### `ra_vfs` | 129 | ### `ra_vfs` |
130 | 130 | ||
131 | Although `hir` and `ra_ide_api` don't do any IO, we need to be able to read | 131 | Although `hir` and `ra_ide` don't do any IO, we need to be able to read |
132 | files from disk at the end of the day. This is what `ra_vfs` does. It also | 132 | files from disk at the end of the day. This is what `ra_vfs` does. It also |
133 | manages overlays: "dirty" files in the editor, whose "true" contents is | 133 | manages overlays: "dirty" files in the editor, whose "true" contents is |
134 | different from data on disk. This is more or less the single really | 134 | different from data on disk. This is more or less the single really |
@@ -162,13 +162,13 @@ disk. For this reason, we try to avoid writing too many tests on this boundary: | |||
162 | in a statically typed language, it's hard to make an error in the protocol | 162 | in a statically typed language, it's hard to make an error in the protocol |
163 | itself if messages are themselves typed. | 163 | itself if messages are themselves typed. |
164 | 164 | ||
165 | The middle, and most important, boundary is `ra_ide_api`. Unlike | 165 | The middle, and most important, boundary is `ra_ide`. Unlike |
166 | `ra_lsp_server`, which exposes API, `ide_api` uses Rust API and is intended to | 166 | `ra_lsp_server`, which exposes API, `ide` uses Rust API and is intended to |
167 | use by various tools. Typical test creates an `AnalysisHost`, calls some | 167 | use by various tools. Typical test creates an `AnalysisHost`, calls some |
168 | `Analysis` functions and compares the results against expectation. | 168 | `Analysis` functions and compares the results against expectation. |
169 | 169 | ||
170 | The innermost and most elaborate boundary is `hir`. It has a much richer | 170 | The innermost and most elaborate boundary is `hir`. It has a much richer |
171 | vocabulary of types than `ide_api`, but the basic testing setup is the same: we | 171 | vocabulary of types than `ide`, but the basic testing setup is the same: we |
172 | create a database, run some queries, assert result. | 172 | create a database, run some queries, assert result. |
173 | 173 | ||
174 | For comparisons, we use [insta](https://github.com/mitsuhiko/insta/) library for | 174 | For comparisons, we use [insta](https://github.com/mitsuhiko/insta/) library for |
diff --git a/docs/dev/guide.md b/docs/dev/guide.md index abbe4c154..c163a74b3 100644 --- a/docs/dev/guide.md +++ b/docs/dev/guide.md | |||
@@ -40,8 +40,8 @@ terms of files and offsets, and **not** in terms of Rust concepts like structs, | |||
40 | traits, etc. The "typed" API with Rust specific types is slightly lower in the | 40 | traits, etc. The "typed" API with Rust specific types is slightly lower in the |
41 | stack, we'll talk about it later. | 41 | stack, we'll talk about it later. |
42 | 42 | ||
43 | [`AnalysisHost`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/lib.rs#L265-L284 | 43 | [`AnalysisHost`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/lib.rs#L265-L284 |
44 | [`Analysis`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/lib.rs#L291-L478 | 44 | [`Analysis`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/lib.rs#L291-L478 |
45 | 45 | ||
46 | The reason for this separation of `Analysis` and `AnalysisHost` is that we want to apply | 46 | The reason for this separation of `Analysis` and `AnalysisHost` is that we want to apply |
47 | changes "uniquely", but we might also want to fork an `Analysis` and send it to | 47 | changes "uniquely", but we might also want to fork an `Analysis` and send it to |
@@ -69,7 +69,7 @@ the `AnalysisHost::apply_change` method, which accepts a single argument, a | |||
69 | "transaction", so it suffices to study its methods to understand all of the | 69 | "transaction", so it suffices to study its methods to understand all of the |
70 | input data. | 70 | input data. |
71 | 71 | ||
72 | [`AnalysisChange`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/lib.rs#L119-L167 | 72 | [`AnalysisChange`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/lib.rs#L119-L167 |
73 | 73 | ||
74 | The `(add|change|remove)_file` methods control the set of the input files, where | 74 | The `(add|change|remove)_file` methods control the set of the input files, where |
75 | each file has an integer id (`FileId`, picked by the client), text (`String`) | 75 | each file has an integer id (`FileId`, picked by the client), text (`String`) |
@@ -253,7 +253,7 @@ All analyzer information is stored in a salsa database. `Analysis` and | |||
253 | `AnalysisHost` types are newtype wrappers for [`RootDatabase`] -- a salsa | 253 | `AnalysisHost` types are newtype wrappers for [`RootDatabase`] -- a salsa |
254 | database. | 254 | database. |
255 | 255 | ||
256 | [`RootDatabase`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/db.rs#L88-L134 | 256 | [`RootDatabase`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/db.rs#L88-L134 |
257 | 257 | ||
258 | Salsa input queries are defined in [`FilesDatabase`] (which is a part of | 258 | 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 `AnalysisChange` structure: |
@@ -565,11 +565,11 @@ the type to completion. | |||
565 | [schedule it on the threadpool]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L428 | 565 | [schedule it on the threadpool]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L428 |
566 | [catch]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L436-L442 | 566 | [catch]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_lsp_server/src/main_loop.rs#L436-L442 |
567 | [the handler]: https://salsa.zulipchat.com/#narrow/stream/181542-rfcs.2Fsalsa-query-group/topic/design.20next.20steps | 567 | [the handler]: https://salsa.zulipchat.com/#narrow/stream/181542-rfcs.2Fsalsa-query-group/topic/design.20next.20steps |
568 | [ask analysis for completion]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/lib.rs#L439-L444 | 568 | [ask analysis for completion]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/lib.rs#L439-L444 |
569 | [completion implementation]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion.rs#L46-L62 | 569 | [completion implementation]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/completion.rs#L46-L62 |
570 | [`CompletionContext`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion/completion_context.rs#L14-L37 | 570 | [`CompletionContext`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/completion/completion_context.rs#L14-L37 |
571 | ["IntelliJ Trick"]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion/completion_context.rs#L72-L75 | 571 | ["IntelliJ Trick"]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/completion/completion_context.rs#L72-L75 |
572 | [find an ancestor `fn` node]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion/completion_context.rs#L116-L120 | 572 | [find an ancestor `fn` node]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/completion/completion_context.rs#L116-L120 |
573 | [semantic model]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion/completion_context.rs#L123 | 573 | [semantic model]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/completion/completion_context.rs#L123 |
574 | [series of independent completion routines]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion.rs#L52-L59 | 574 | [series of independent completion routines]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/completion.rs#L52-L59 |
575 | [`complete_dot`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide_api/src/completion/complete_dot.rs#L6-L22 | 575 | [`complete_dot`]: https://github.com/rust-analyzer/rust-analyzer/blob/guide-2019-01/crates/ra_ide/src/completion/complete_dot.rs#L6-L22 |