diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-12-10 14:28:33 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-12-10 14:28:33 +0000 |
commit | f655f993fe6d9faa81b0e776b9b24308d2ea1c68 (patch) | |
tree | 7382000b577808901237b6b547f16d41d78eb8ed | |
parent | 038ae23b71f285ea5c5a2e0c436b662de4befb3e (diff) | |
parent | 6d14bb0cd0af55fe45711ac048236f9dd9d24a3f (diff) |
Merge #275
275: Update ARCHITECTURE.md r=matklad a=h-michael
I am still not familiar with the code base, so mostly I quote crate's comments.
Co-authored-by: Hirokazu Hata <[email protected]>
-rw-r--r-- | ARCHITECTURE.md | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index f16ff782c..a6b1bf873 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md | |||
@@ -58,6 +58,14 @@ all `//test test_name` comments into files inside `tests/data` directory. | |||
58 | See [#93](https://github.com/rust-analyzer/rust-analyzer/pull/93) for an example PR which | 58 | See [#93](https://github.com/rust-analyzer/rust-analyzer/pull/93) for an example PR which |
59 | fixes a bug in the grammar. | 59 | fixes a bug in the grammar. |
60 | 60 | ||
61 | ### `crates/ra_hir` | ||
62 | |||
63 | HIR (previsouly known as descriptors) provides a high-level OO acess to Rust | ||
64 | code. | ||
65 | |||
66 | The principal difference between HIR and syntax trees is that HIR is bound | ||
67 | to a particular crate instance. That is, it has cfg flags and features | ||
68 | applied. So, there relation between syntax and HIR is many-to-one. | ||
61 | 69 | ||
62 | ### `crates/ra_editor` | 70 | ### `crates/ra_editor` |
63 | 71 | ||
@@ -72,13 +80,6 @@ syntax tree as an input. | |||
72 | The tests for `ra_editor` are `#[cfg(test)] mod tests` unit-tests spread | 80 | The tests for `ra_editor` are `#[cfg(test)] mod tests` unit-tests spread |
73 | throughout its modules. | 81 | throughout its modules. |
74 | 82 | ||
75 | ### `crates/salsa` | ||
76 | |||
77 | An implementation of red-green incremental compilation algorithm from | ||
78 | rust compiler. It makes all rust-analyzer features on-demand. To be replaced | ||
79 | with `salsa-rs/salsa` soon. | ||
80 | |||
81 | |||
82 | ### `crates/ra_analysis` | 83 | ### `crates/ra_analysis` |
83 | 84 | ||
84 | A stateful library for analyzing many Rust files as they change. | 85 | A stateful library for analyzing many Rust files as they change. |
@@ -87,6 +88,8 @@ current state, incorporates changes and handles out `Analysis` --- an | |||
87 | immutable consistent snapshot of world state at a point in time, which | 88 | immutable consistent snapshot of world state at a point in time, which |
88 | actually powers analysis. | 89 | actually powers analysis. |
89 | 90 | ||
91 | ### `crates/ra_db` | ||
92 | This defines basic database traits. Concrete DB is defined by ra_analysis. | ||
90 | 93 | ||
91 | ### `crates/ra_lsp_server` | 94 | ### `crates/ra_lsp_server` |
92 | 95 | ||
@@ -97,8 +100,15 @@ See [#79](https://github.com/rust-analyzer/rust-analyzer/pull/79/) as an | |||
97 | example of PR which adds a new feature to `ra_editor` and exposes it | 100 | example of PR which adds a new feature to `ra_editor` and exposes it |
98 | to `ra_lsp_server`. | 101 | to `ra_lsp_server`. |
99 | 102 | ||
103 | ### `crates/gen_lsp_server` | ||
104 | |||
105 | A language server scaffold, exposing a synchronous crossbeam-channel based API. | ||
106 | This crate handles protocol handshaking and parsing messages, while you | ||
107 | control the message dispatch loop yourself. | ||
108 | |||
109 | Run with `RUST_LOG=sync_lsp_server=debug` to see all the messages. | ||
100 | 110 | ||
101 | ### `crates/cli` | 111 | ### `crates/ra_cli` |
102 | 112 | ||
103 | A CLI interface to rust-analyzer. | 113 | A CLI interface to rust-analyzer. |
104 | 114 | ||