aboutsummaryrefslogtreecommitdiff
path: root/docs/dev
diff options
context:
space:
mode:
Diffstat (limited to 'docs/dev')
-rw-r--r--docs/dev/architecture.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/dev/architecture.md b/docs/dev/architecture.md
index e2237ca95..fb991133a 100644
--- a/docs/dev/architecture.md
+++ b/docs/dev/architecture.md
@@ -97,13 +97,13 @@ See [RFC](https://github.com/rust-lang/rfcs/pull/2256) and [./syntax.md](./synta
97 97
98- [rowan](https://github.com/rust-analyzer/rowan) library is used for constructing syntax trees. 98- [rowan](https://github.com/rust-analyzer/rowan) library is used for constructing syntax trees.
99- `ast` provides a type safe API on top of the raw `rowan` tree. 99- `ast` provides a type safe API on top of the raw `rowan` tree.
100- `ungrammar` description of the grammar, which is used to generate `syntax_kinds` and `ast` modules, using `cargo xtask codegen` command. 100- `ungrammar` description of the grammar, which is used to generate `syntax_kinds` and `ast` modules, using `cargo test -p xtask` command.
101 101
102Tests for ra_syntax are mostly data-driven. 102Tests for ra_syntax are mostly data-driven.
103`test_data/parser` contains subdirectories with a bunch of `.rs` (test vectors) and `.txt` files with corresponding syntax trees. 103`test_data/parser` contains subdirectories with a bunch of `.rs` (test vectors) and `.txt` files with corresponding syntax trees.
104During testing, we check `.rs` against `.txt`. 104During testing, we check `.rs` against `.txt`.
105If the `.txt` file is missing, it is created (this is how you update tests). 105If the `.txt` file is missing, it is created (this is how you update tests).
106Additionally, running `cargo xtask codegen` will walk the grammar module and collect all `// test test_name` comments into files inside `test_data/parser/inline` directory. 106Additionally, running the xtask test suite with `cargo test -p xtask` will walk the grammar module and collect all `// test test_name` comments into files inside `test_data/parser/inline` directory.
107 107
108To update test data, run with `UPDATE_EXPECT` variable: 108To update test data, run with `UPDATE_EXPECT` variable:
109 109
@@ -111,7 +111,7 @@ To update test data, run with `UPDATE_EXPECT` variable:
111env UPDATE_EXPECT=1 cargo qt 111env UPDATE_EXPECT=1 cargo qt
112``` 112```
113 113
114After adding a new inline test you need to run `cargo xtest codegen` and also update the test data as described above. 114After adding a new inline test you need to run `cargo test -p xtask` and also update the test data as described above.
115 115
116Note [`api_walkthrough`](https://github.com/rust-analyzer/rust-analyzer/blob/2fb6af89eb794f775de60b82afe56b6f986c2a40/crates/ra_syntax/src/lib.rs#L190-L348) 116Note [`api_walkthrough`](https://github.com/rust-analyzer/rust-analyzer/blob/2fb6af89eb794f775de60b82afe56b6f986c2a40/crates/ra_syntax/src/lib.rs#L190-L348)
117in particular: it shows off various methods of working with syntax tree. 117in particular: it shows off various methods of working with syntax tree.