diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/dev/README.md | 2 | ||||
-rw-r--r-- | docs/dev/style.md | 8 | ||||
-rw-r--r-- | docs/user/generated_config.adoc | 6 |
3 files changed, 10 insertions, 6 deletions
diff --git a/docs/dev/README.md b/docs/dev/README.md index d6fae5295..b91013f13 100644 --- a/docs/dev/README.md +++ b/docs/dev/README.md | |||
@@ -58,8 +58,6 @@ Use `env RUN_SLOW_TESTS=1 cargo test` to run the full suite. | |||
58 | 58 | ||
59 | We use bors-ng to enforce the [not rocket science](https://graydon2.dreamwidth.org/1597.html) rule. | 59 | We use bors-ng to enforce the [not rocket science](https://graydon2.dreamwidth.org/1597.html) rule. |
60 | 60 | ||
61 | You can run `cargo xtask install-pre-commit-hook` to install git-hook to run rustfmt on commit. | ||
62 | |||
63 | # Launching rust-analyzer | 61 | # Launching rust-analyzer |
64 | 62 | ||
65 | Debugging the language server can be tricky. | 63 | Debugging the language server can be tricky. |
diff --git a/docs/dev/style.md b/docs/dev/style.md index dd71e3932..93ad98f20 100644 --- a/docs/dev/style.md +++ b/docs/dev/style.md | |||
@@ -769,14 +769,20 @@ fn foo() -> Option<Bar> { | |||
769 | 769 | ||
770 | ## Comparisons | 770 | ## Comparisons |
771 | 771 | ||
772 | Use `<`/`<=`, avoid `>`/`>=`. | 772 | When doing multiple comparisons use `<`/`<=`, avoid `>`/`>=`. |
773 | 773 | ||
774 | ```rust | 774 | ```rust |
775 | // GOOD | 775 | // GOOD |
776 | assert!(lo <= x && x <= hi); | 776 | assert!(lo <= x && x <= hi); |
777 | assert!(r1 < l2 || r2 < l1); | ||
778 | assert!(x < y); | ||
779 | assert!(x > 0); | ||
777 | 780 | ||
778 | // BAD | 781 | // BAD |
779 | assert!(x >= lo && x <= hi>); | 782 | assert!(x >= lo && x <= hi>); |
783 | assert!(r1 < l2 || l1 > r2); | ||
784 | assert!(y > x); | ||
785 | assert!(0 > x); | ||
780 | ``` | 786 | ``` |
781 | 787 | ||
782 | **Rationale:** Less-then comparisons are more intuitive, they correspond spatially to [real line](https://en.wikipedia.org/wiki/Real_line). | 788 | **Rationale:** Less-then comparisons are more intuitive, they correspond spatially to [real line](https://en.wikipedia.org/wiki/Real_line). |
diff --git a/docs/user/generated_config.adoc b/docs/user/generated_config.adoc index f91e04c31..1dbf2a611 100644 --- a/docs/user/generated_config.adoc +++ b/docs/user/generated_config.adoc | |||
@@ -10,8 +10,8 @@ | |||
10 | Activate all available features (`--all-features`). | 10 | Activate all available features (`--all-features`). |
11 | [[rust-analyzer.cargo.features]]rust-analyzer.cargo.features (default: `[]`):: | 11 | [[rust-analyzer.cargo.features]]rust-analyzer.cargo.features (default: `[]`):: |
12 | List of features to activate. | 12 | List of features to activate. |
13 | [[rust-analyzer.cargo.loadOutDirsFromCheck]]rust-analyzer.cargo.loadOutDirsFromCheck (default: `false`):: | 13 | [[rust-analyzer.cargo.runBuildScripts]]rust-analyzer.cargo.runBuildScripts (default: `false`):: |
14 | Run `cargo check` on startup to get the correct value for package OUT_DIRs. | 14 | Run build scripts (`build.rs`) for more precise code analysis. |
15 | [[rust-analyzer.cargo.noDefaultFeatures]]rust-analyzer.cargo.noDefaultFeatures (default: `false`):: | 15 | [[rust-analyzer.cargo.noDefaultFeatures]]rust-analyzer.cargo.noDefaultFeatures (default: `false`):: |
16 | Do not activate the `default` feature. | 16 | Do not activate the `default` feature. |
17 | [[rust-analyzer.cargo.target]]rust-analyzer.cargo.target (default: `null`):: | 17 | [[rust-analyzer.cargo.target]]rust-analyzer.cargo.target (default: `null`):: |
@@ -97,7 +97,7 @@ | |||
97 | [[rust-analyzer.notifications.cargoTomlNotFound]]rust-analyzer.notifications.cargoTomlNotFound (default: `true`):: | 97 | [[rust-analyzer.notifications.cargoTomlNotFound]]rust-analyzer.notifications.cargoTomlNotFound (default: `true`):: |
98 | Whether to show `can't find Cargo.toml` error message. | 98 | Whether to show `can't find Cargo.toml` error message. |
99 | [[rust-analyzer.procMacro.enable]]rust-analyzer.procMacro.enable (default: `false`):: | 99 | [[rust-analyzer.procMacro.enable]]rust-analyzer.procMacro.enable (default: `false`):: |
100 | Enable Proc macro support, `#rust-analyzer.cargo.loadOutDirsFromCheck#` must be enabled. | 100 | Enable support for procedural macros, implies `#rust-analyzer.cargo.runBuildScripts#`. |
101 | [[rust-analyzer.procMacro.server]]rust-analyzer.procMacro.server (default: `null`):: | 101 | [[rust-analyzer.procMacro.server]]rust-analyzer.procMacro.server (default: `null`):: |
102 | Internal config, path to proc-macro server executable (typically, this is rust-analyzer itself, but we override this in tests). | 102 | Internal config, path to proc-macro server executable (typically, this is rust-analyzer itself, but we override this in tests). |
103 | [[rust-analyzer.runnables.overrideCargo]]rust-analyzer.runnables.overrideCargo (default: `null`):: | 103 | [[rust-analyzer.runnables.overrideCargo]]rust-analyzer.runnables.overrideCargo (default: `null`):: |