diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/dev/debugging.md | 5 | ||||
-rw-r--r-- | docs/dev/style.md | 7 | ||||
-rw-r--r-- | docs/user/.gitignore | 1 | ||||
-rw-r--r-- | docs/user/generated_config.adoc | 10 | ||||
-rw-r--r-- | docs/user/manual.adoc | 20 |
5 files changed, 40 insertions, 3 deletions
diff --git a/docs/dev/debugging.md b/docs/dev/debugging.md index 5876e71bc..48caec1d8 100644 --- a/docs/dev/debugging.md +++ b/docs/dev/debugging.md | |||
@@ -65,6 +65,11 @@ If you need to debug the server from the very beginning, including its initializ | |||
65 | } | 65 | } |
66 | ``` | 66 | ``` |
67 | 67 | ||
68 | However for this to work, you will need to enable debug_assertions in your build | ||
69 | ```rust | ||
70 | RUSTFLAGS='--cfg debug_assertions' cargo build --release | ||
71 | ``` | ||
72 | |||
68 | ## Demo | 73 | ## Demo |
69 | 74 | ||
70 | - [Debugging TypeScript VScode extension](https://www.youtube.com/watch?v=T-hvpK6s4wM). | 75 | - [Debugging TypeScript VScode extension](https://www.youtube.com/watch?v=T-hvpK6s4wM). |
diff --git a/docs/dev/style.md b/docs/dev/style.md index 96dd684b3..84485ea28 100644 --- a/docs/dev/style.md +++ b/docs/dev/style.md | |||
@@ -174,6 +174,13 @@ Instead, explicitly check for `None`, `Err`, etc. | |||
174 | `rust-analyzer` is not a library, we don't need to test for API misuse, and we have to handle any user input without panics. | 174 | `rust-analyzer` is not a library, we don't need to test for API misuse, and we have to handle any user input without panics. |
175 | Panic messages in the logs from the `#[should_panic]` tests are confusing. | 175 | Panic messages in the logs from the `#[should_panic]` tests are confusing. |
176 | 176 | ||
177 | ## `#[ignore]` | ||
178 | |||
179 | Do not `#[ignore]` tests. | ||
180 | If the test currently does not work, assert the wrong behavior and add a fixme explaining why it is wrong. | ||
181 | |||
182 | **Rationale:** noticing when the behavior is fixed, making sure that even the wrong behavior is acceptable (ie, not a panic). | ||
183 | |||
177 | ## Function Preconditions | 184 | ## Function Preconditions |
178 | 185 | ||
179 | Express function preconditions in types and force the caller to provide them (rather than checking in callee): | 186 | Express function preconditions in types and force the caller to provide them (rather than checking in callee): |
diff --git a/docs/user/.gitignore b/docs/user/.gitignore new file mode 100644 index 000000000..c32b1bcec --- /dev/null +++ b/docs/user/.gitignore | |||
@@ -0,0 +1 @@ | |||
manual.html | |||
diff --git a/docs/user/generated_config.adoc b/docs/user/generated_config.adoc index 4105d784f..cc7fdd38f 100644 --- a/docs/user/generated_config.adoc +++ b/docs/user/generated_config.adoc | |||
@@ -18,6 +18,11 @@ The path structure for newly inserted paths to use. | |||
18 | -- | 18 | -- |
19 | Group inserted imports by the [following order](https://rust-analyzer.github.io/manual.html#auto-import). Groups are separated by newlines. | 19 | Group inserted imports by the [following order](https://rust-analyzer.github.io/manual.html#auto-import). Groups are separated by newlines. |
20 | -- | 20 | -- |
21 | [[rust-analyzer.assist.allowMergingIntoGlobImports]]rust-analyzer.assist.allowMergingIntoGlobImports (default: `true`):: | ||
22 | + | ||
23 | -- | ||
24 | Whether to allow import insertion to merge new imports into single path glob imports like `use std::fmt::*;`. | ||
25 | -- | ||
21 | [[rust-analyzer.callInfo.full]]rust-analyzer.callInfo.full (default: `true`):: | 26 | [[rust-analyzer.callInfo.full]]rust-analyzer.callInfo.full (default: `true`):: |
22 | + | 27 | + |
23 | -- | 28 | -- |
@@ -34,6 +39,11 @@ Automatically refresh project info via `cargo metadata` on | |||
34 | -- | 39 | -- |
35 | Activate all available features (`--all-features`). | 40 | Activate all available features (`--all-features`). |
36 | -- | 41 | -- |
42 | [[rust-analyzer.cargo.unsetTest]]rust-analyzer.cargo.unsetTest (default: `["core"]`):: | ||
43 | + | ||
44 | -- | ||
45 | Unsets `#[cfg(test)]` for the specified crates. | ||
46 | -- | ||
37 | [[rust-analyzer.cargo.features]]rust-analyzer.cargo.features (default: `[]`):: | 47 | [[rust-analyzer.cargo.features]]rust-analyzer.cargo.features (default: `[]`):: |
38 | + | 48 | + |
39 | -- | 49 | -- |
diff --git a/docs/user/manual.adoc b/docs/user/manual.adoc index 9a8d76700..816e094c2 100644 --- a/docs/user/manual.adoc +++ b/docs/user/manual.adoc | |||
@@ -201,6 +201,15 @@ $ eselect repository enable guru && emaint sync -r guru | |||
201 | $ emerge rust-analyzer-bin | 201 | $ emerge rust-analyzer-bin |
202 | ---- | 202 | ---- |
203 | 203 | ||
204 | ==== macOS | ||
205 | |||
206 | The `rust-analyzer` binary can be installed via https://brew.sh/[Homebrew]. | ||
207 | |||
208 | [source,bash] | ||
209 | ---- | ||
210 | $ brew install rust-analyzer | ||
211 | ---- | ||
212 | |||
204 | === Emacs | 213 | === Emacs |
205 | 214 | ||
206 | Note this excellent https://robert.kra.hn/posts/2021-02-07_rust-with-emacs/[guide] from https://github.com/rksm[@rksm]. | 215 | Note this excellent https://robert.kra.hn/posts/2021-02-07_rust-with-emacs/[guide] from https://github.com/rksm[@rksm]. |
@@ -609,9 +618,14 @@ Here is a **non-exhaustive** list of ways to make rust-analyzer execute arbitrar | |||
609 | * VS Code plugin reads configuration from project directory, and that can be used to override paths to various executables, like `rustfmt` or `rust-analyzer` itself. | 618 | * VS Code plugin reads configuration from project directory, and that can be used to override paths to various executables, like `rustfmt` or `rust-analyzer` itself. |
610 | * rust-analyzer's syntax trees library uses a lot of `unsafe` and hasn't been properly audited for memory safety. | 619 | * rust-analyzer's syntax trees library uses a lot of `unsafe` and hasn't been properly audited for memory safety. |
611 | 620 | ||
612 | rust-analyzer itself doesn't access the network. | 621 | == Privacy |
613 | The VS Code plugin doesn't access the network unless the nightly channel is selected in the settings. | 622 | |
614 | In that case, the plugin uses the GitHub API to check for and download updates. | 623 | The LSP server performs no network access in itself, but runs `cargo metadata` which will update or download the crate registry and the source code of the project dependencies. |
624 | If enabled (the default), build scripts and procedural macros can do anything. | ||
625 | |||
626 | The Code extension automatically connects to GitHub to download updated LSP binaries and, if the nightly channel is selected, to perform update checks using the GitHub API. For `rust-analyzer` developers, using `cargo xtask release` uses the same API to put together the release notes. | ||
627 | |||
628 | Any other editor plugins are not under the control of the `rust-analyzer` developers. For any privacy concerns, you should check with their respective developers. | ||
615 | 629 | ||
616 | == Features | 630 | == Features |
617 | 631 | ||