aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/dev/architecture.md6
-rw-r--r--docs/user/README.md3
2 files changed, 6 insertions, 3 deletions
diff --git a/docs/dev/architecture.md b/docs/dev/architecture.md
index 9e9651801..1201f6e5a 100644
--- a/docs/dev/architecture.md
+++ b/docs/dev/architecture.md
@@ -70,7 +70,7 @@ Rust syntax tree structure and parser. See
70 70
71- [rowan](https://github.com/rust-analyzer/rowan) library is used for constructing syntax trees. 71- [rowan](https://github.com/rust-analyzer/rowan) library is used for constructing syntax trees.
72- `grammar` module is the actual parser. It is a hand-written recursive descent parser, which 72- `grammar` module is the actual parser. It is a hand-written recursive descent parser, which
73 produces a sequence of events like "start node X", "finish not Y". It works similarly to [kotlin's parser](https://github.com/JetBrains/kotlin/blob/4d951de616b20feca92f3e9cc9679b2de9e65195/compiler/frontend/src/org/jetbrains/kotlin/parsing/KotlinParsing.java), 73 produces a sequence of events like "start node X", "finish node Y". It works similarly to [kotlin's parser](https://github.com/JetBrains/kotlin/blob/4d951de616b20feca92f3e9cc9679b2de9e65195/compiler/frontend/src/org/jetbrains/kotlin/parsing/KotlinParsing.java),
74 which is a good source of inspiration for dealing with syntax errors and incomplete input. Original [libsyntax parser](https://github.com/rust-lang/rust/blob/6b99adeb11313197f409b4f7c4083c2ceca8a4fe/src/libsyntax/parse/parser.rs) 74 which is a good source of inspiration for dealing with syntax errors and incomplete input. Original [libsyntax parser](https://github.com/rust-lang/rust/blob/6b99adeb11313197f409b4f7c4083c2ceca8a4fe/src/libsyntax/parse/parser.rs)
75 is what we use for the definition of the Rust language. 75 is what we use for the definition of the Rust language.
76- `parser_api/parser_impl` bridges the tree-agnostic parser from `grammar` with `rowan` trees. 76- `parser_api/parser_impl` bridges the tree-agnostic parser from `grammar` with `rowan` trees.
@@ -83,11 +83,11 @@ Rust syntax tree structure and parser. See
83 visiting the nodes (this is double plus cool, if you understand how 83 visiting the nodes (this is double plus cool, if you understand how
84 `Visitor` works, you understand the design of syntax trees). 84 `Visitor` works, you understand the design of syntax trees).
85 85
86Tests for ra_syntax are mostly data-driven: `tests/data/parser` contains a bunch of `.rs` 86Tests for ra_syntax are mostly data-driven: `test_data/parser` contains subdirectories with a bunch of `.rs`
87(test vectors) and `.txt` files with corresponding syntax trees. During testing, we check 87(test vectors) and `.txt` files with corresponding syntax trees. During testing, we check
88`.rs` against `.txt`. If the `.txt` file is missing, it is created (this is how you update 88`.rs` against `.txt`. If the `.txt` file is missing, it is created (this is how you update
89tests). Additionally, running `cargo gen-tests` will walk the grammar module and collect 89tests). Additionally, running `cargo gen-tests` will walk the grammar module and collect
90all `//test test_name` comments into files inside `tests/data` directory. 90all `// test test_name` comments into files inside `test_data/parser/inline` directory.
91 91
92See [#93](https://github.com/rust-analyzer/rust-analyzer/pull/93) for an example PR which 92See [#93](https://github.com/rust-analyzer/rust-analyzer/pull/93) for an example PR which
93fixes a bug in the grammar. 93fixes a bug in the grammar.
diff --git a/docs/user/README.md b/docs/user/README.md
index a5e17f604..7990d1d31 100644
--- a/docs/user/README.md
+++ b/docs/user/README.md
@@ -71,6 +71,9 @@ See https://github.com/microsoft/vscode/issues/72308[microsoft/vscode#72308] for
71* `rust-analyzer.raLspServerPath`: path to `ra_lsp_server` executable 71* `rust-analyzer.raLspServerPath`: path to `ra_lsp_server` executable
72* `rust-analyzer.enableCargoWatchOnStartup`: prompt to install & enable `cargo 72* `rust-analyzer.enableCargoWatchOnStartup`: prompt to install & enable `cargo
73 watch` for live error highlighting (note, this **does not** use rust-analyzer) 73 watch` for live error highlighting (note, this **does not** use rust-analyzer)
74* `rust-analyzer.excludeGlobs`: a list of glob-patterns for exclusion (see globset [docs](https://docs.rs/globset) for syntax).
75 Note: glob patterns are applied to all Cargo packages and a rooted at a package root.
76 This is not very intuitive and a limitation of a current implementation.
74* `rust-analyzer.cargo-watch.check-arguments`: cargo-watch check arguments. 77* `rust-analyzer.cargo-watch.check-arguments`: cargo-watch check arguments.
75 (e.g: `--features="shumway,pdf"` will run as `cargo watch -x "check --features="shumway,pdf""` ) 78 (e.g: `--features="shumway,pdf"` will run as `cargo watch -x "check --features="shumway,pdf""` )
76* `rust-analyzer.trace.server`: enables internal logging 79* `rust-analyzer.trace.server`: enables internal logging