diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/dev/lsp-extensions.md | 3 | ||||
-rw-r--r-- | docs/dev/style.md | 61 | ||||
-rw-r--r-- | docs/user/manual.adoc | 11 |
3 files changed, 54 insertions, 21 deletions
diff --git a/docs/dev/lsp-extensions.md b/docs/dev/lsp-extensions.md index 43a69d6ce..780f5cb91 100644 --- a/docs/dev/lsp-extensions.md +++ b/docs/dev/lsp-extensions.md | |||
@@ -392,7 +392,10 @@ rust-analyzer supports only one `kind`, `"cargo"`. The `args` for `"cargo"` look | |||
392 | { | 392 | { |
393 | workspaceRoot?: string; | 393 | workspaceRoot?: string; |
394 | cargoArgs: string[]; | 394 | cargoArgs: string[]; |
395 | cargoExtraArgs: string[]; | ||
395 | executableArgs: string[]; | 396 | executableArgs: string[]; |
397 | expectTest?: boolean; | ||
398 | overrideCargo?: string; | ||
396 | } | 399 | } |
397 | ``` | 400 | ``` |
398 | 401 | ||
diff --git a/docs/dev/style.md b/docs/dev/style.md index 883a6845d..7a64a0d22 100644 --- a/docs/dev/style.md +++ b/docs/dev/style.md | |||
@@ -366,27 +366,66 @@ People read things from top to bottom, so place most important things first. | |||
366 | 366 | ||
367 | Specifically, if all items except one are private, always put the non-private item on top. | 367 | Specifically, if all items except one are private, always put the non-private item on top. |
368 | 368 | ||
369 | Put `struct`s and `enum`s first, functions and impls last. | ||
370 | |||
371 | Do | ||
372 | |||
373 | ```rust | 369 | ```rust |
374 | // Good | 370 | // Good |
375 | struct Foo { | 371 | pub(crate) fn frobnicate() { |
376 | bars: Vec<Bar> | 372 | Helper::act() |
373 | } | ||
374 | |||
375 | #[derive(Default)] | ||
376 | struct Helper { stuff: i32 } | ||
377 | |||
378 | impl Helper { | ||
379 | fn act(&self) { | ||
380 | |||
381 | } | ||
382 | } | ||
383 | |||
384 | // Not as good | ||
385 | #[derive(Default)] | ||
386 | struct Helper { stuff: i32 } | ||
387 | |||
388 | pub(crate) fn frobnicate() { | ||
389 | Helper::act() | ||
377 | } | 390 | } |
378 | 391 | ||
379 | struct Bar; | 392 | impl Helper { |
393 | fn act(&self) { | ||
394 | |||
395 | } | ||
396 | } | ||
380 | ``` | 397 | ``` |
381 | 398 | ||
382 | rather than | 399 | If there's a mixture of private and public items, put public items first. |
400 | If function bodies are folded in the editor, the source code should read as documentation for the public API. | ||
401 | |||
402 | Put `struct`s and `enum`s first, functions and impls last. Order types declarations in top-down manner. | ||
383 | 403 | ||
384 | ```rust | 404 | ```rust |
405 | // Good | ||
406 | struct Parent { | ||
407 | children: Vec<Child> | ||
408 | } | ||
409 | |||
410 | struct Child; | ||
411 | |||
412 | impl Parent { | ||
413 | } | ||
414 | |||
415 | impl Child { | ||
416 | } | ||
417 | |||
385 | // Not as good | 418 | // Not as good |
386 | struct Bar; | 419 | struct Child; |
387 | 420 | ||
388 | struct Foo { | 421 | impl Child { |
389 | bars: Vec<Bar> | 422 | } |
423 | |||
424 | struct Parent { | ||
425 | children: Vec<Child> | ||
426 | } | ||
427 | |||
428 | impl Parent { | ||
390 | } | 429 | } |
391 | ``` | 430 | ``` |
392 | 431 | ||
diff --git a/docs/user/manual.adoc b/docs/user/manual.adoc index 46e7bd091..8a3cc00df 100644 --- a/docs/user/manual.adoc +++ b/docs/user/manual.adoc | |||
@@ -260,16 +260,7 @@ If you get an error saying `No such file or directory: 'rust-analyzer'`, see the | |||
260 | 260 | ||
261 | === GNOME Builder | 261 | === GNOME Builder |
262 | 262 | ||
263 | Prerequisites: You have installed the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>. | 263 | GNOME Builder 3.37.1 and newer has native `rust-analyzer` support. If the LSP binary is not available, GNOME Builder can install it when opening a Rust file. |
264 | |||
265 | Gnome Builder currently has support for RLS, and there's no way to configure the language server executable. A future version might support `rust-analyzer` out of the box. | ||
266 | |||
267 | 1. Rename, symlink or copy the `rust-analyzer` binary to `rls` and place it somewhere Builder can find (in `PATH`, or under `~/.cargo/bin`). | ||
268 | 2. Enable the Rust Builder plugin. | ||
269 | |||
270 | ==== GNOME Builder (Nightly) | ||
271 | |||
272 | https://nightly.gnome.org/repo/appstream/org.gnome.Builder.flatpakref[GNOME Builder (Nightly)] has now native support for `rust-analyzer` out of the box. If the `rust-analyzer` binary is not available, GNOME Builder can install it when opening a Rust source file. | ||
273 | 264 | ||
274 | == Non-Cargo Based Projects | 265 | == Non-Cargo Based Projects |
275 | 266 | ||