aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/dev/lsp-extensions.md9
-rw-r--r--docs/dev/style.md19
-rw-r--r--docs/user/manual.adoc4
3 files changed, 24 insertions, 8 deletions
diff --git a/docs/dev/lsp-extensions.md b/docs/dev/lsp-extensions.md
index 2e3133449..f1160bb1c 100644
--- a/docs/dev/lsp-extensions.md
+++ b/docs/dev/lsp-extensions.md
@@ -390,7 +390,14 @@ rust-analyzer supports only one `kind`, `"cargo"`. The `args` for `"cargo"` look
390 390
391**Method:** `rust-analyzer/analyzerStatus` 391**Method:** `rust-analyzer/analyzerStatus`
392 392
393**Request:** `null` 393**Request:**
394
395```typescript
396interface AnalyzerStatusParams {
397 /// If specified, show dependencies of the current file.
398 textDocument?: TextDocumentIdentifier;
399}
400```
394 401
395**Response:** `string` 402**Response:** `string`
396 403
diff --git a/docs/dev/style.md b/docs/dev/style.md
index bcd86fd3f..fb407afcd 100644
--- a/docs/dev/style.md
+++ b/docs/dev/style.md
@@ -197,7 +197,7 @@ fn frobnicate(walrus: Option<Walrus>) {
197} 197}
198``` 198```
199 199
200Avoid preconditions that spawn function boundaries: 200Avoid preconditions that span across function boundaries:
201 201
202 202
203```rust 203```rust
@@ -218,9 +218,8 @@ fn foo() {
218} 218}
219 219
220// Not as good 220// Not as good
221fn is_string_literal(s: &str) -> Option<&str> { 221fn is_string_literal(s: &str) -> bool {
222 s.starts_with('"') && s.ends_with('"') 222 s.starts_with('"') && s.ends_with('"')
223 Some()
224} 223}
225 224
226fn foo() { 225fn foo() {
@@ -231,8 +230,8 @@ fn foo() {
231} 230}
232``` 231```
233 232
234In the "Not as good" version, the precondition that `1` is a valid char boundary is checked in `is_string_literal` and utilized in `foo`. 233In the "Not as good" version, the precondition that `1` is a valid char boundary is checked in `is_string_literal` and used in `foo`.
235In the "Good" version, precondition check and usage are checked in the same block, and then encoded in the types. 234In the "Good" version, the precondition check and usage are checked in the same block, and then encoded in the types.
236 235
237# Early Returns 236# Early Returns
238 237
@@ -372,3 +371,13 @@ After you are happy with the state of the code, please use [interactive rebase](
372 371
373Avoid @mentioning people in commit messages and pull request descriptions(they are added to commit message by bors). 372Avoid @mentioning people in commit messages and pull request descriptions(they are added to commit message by bors).
374Such messages create a lot of duplicate notification traffic during rebases. 373Such messages create a lot of duplicate notification traffic during rebases.
374
375# Clippy
376
377We don't enforce Clippy.
378A number of default lints have high false positive rate.
379Selectively patching false-positives with `allow(clippy)` is considered worse than not using Clippy at all.
380There's `cargo xtask lint` command which runs a subset of low-FPR lints.
381Careful tweaking of `xtask lint` is welcome.
382See also [rust-lang/clippy#5537](https://github.com/rust-lang/rust-clippy/issues/5537).
383Of course, applying Clippy suggestions is welcome as long as they indeed improve the code.
diff --git a/docs/user/manual.adoc b/docs/user/manual.adoc
index 7d85b36cb..c1a778852 100644
--- a/docs/user/manual.adoc
+++ b/docs/user/manual.adoc
@@ -113,8 +113,8 @@ Note that installing via `xtask install` does not work for VS Code Remote, inste
113 113
114Here are some useful self-diagnostic commands: 114Here are some useful self-diagnostic commands:
115 115
116* **Rust Analyzer: Show RA Version** shows the version of `rust-analyzer` binary 116* **Rust Analyzer: Show RA Version** shows the version of `rust-analyzer` binary.
117* **Rust Analyzer: Status** prints some statistics about the server, like the few latest LSP requests 117* **Rust Analyzer: Status** prints some statistics about the server, and dependency information for the current file.
118* To enable server-side logging, run with `env RA_LOG=info` and see `Output > Rust Analyzer Language Server` in VS Code's panel. 118* To enable server-side logging, run with `env RA_LOG=info` and see `Output > Rust Analyzer Language Server` in VS Code's panel.
119* To log all LSP requests, add `"rust-analyzer.trace.server": "verbose"` to the settings and look for `Rust Analyzer Language Server Trace` in the panel. 119* To log all LSP requests, add `"rust-analyzer.trace.server": "verbose"` to the settings and look for `Rust Analyzer Language Server Trace` in the panel.
120* To enable client-side logging, add `"rust-analyzer.trace.extension": true` to the settings and open `Output > Rust Analyzer Client` in the panel. 120* To enable client-side logging, add `"rust-analyzer.trace.extension": true` to the settings and open `Output > Rust Analyzer Client` in the panel.