diff options
Diffstat (limited to 'docs/user')
-rw-r--r-- | docs/user/assists.md | 22 | ||||
-rw-r--r-- | docs/user/readme.adoc | 11 |
2 files changed, 31 insertions, 2 deletions
diff --git a/docs/user/assists.md b/docs/user/assists.md index 6c6943622..ee515949e 100644 --- a/docs/user/assists.md +++ b/docs/user/assists.md | |||
@@ -175,7 +175,9 @@ trait Trait<T> { | |||
175 | } | 175 | } |
176 | 176 | ||
177 | impl Trait<u32> for () { | 177 | impl Trait<u32> for () { |
178 | fn foo(&self) -> u32 { todo!() } | 178 | fn foo(&self) -> u32 { |
179 | todo!() | ||
180 | } | ||
179 | 181 | ||
180 | } | 182 | } |
181 | ``` | 183 | ``` |
@@ -695,3 +697,21 @@ use std::┃collections::HashMap; | |||
695 | // AFTER | 697 | // AFTER |
696 | use std::{collections::HashMap}; | 698 | use std::{collections::HashMap}; |
697 | ``` | 699 | ``` |
700 | |||
701 | ## `unwrap_block` | ||
702 | |||
703 | This assist removes if...else, for, while and loop control statements to just keep the body. | ||
704 | |||
705 | ```rust | ||
706 | // BEFORE | ||
707 | fn foo() { | ||
708 | if true {┃ | ||
709 | println!("foo"); | ||
710 | } | ||
711 | } | ||
712 | |||
713 | // AFTER | ||
714 | fn foo() { | ||
715 | println!("foo"); | ||
716 | } | ||
717 | ``` | ||
diff --git a/docs/user/readme.adoc b/docs/user/readme.adoc index 4cb1e23e8..b1af72ce6 100644 --- a/docs/user/readme.adoc +++ b/docs/user/readme.adoc | |||
@@ -201,7 +201,7 @@ let g:LanguageClient_serverCommands = { | |||
201 | 201 | ||
202 | 2. Configure by adding this to your vim/neovim config file (replacing the existing Rust-specific line if it exists): | 202 | 2. Configure by adding this to your vim/neovim config file (replacing the existing Rust-specific line if it exists): |
203 | + | 203 | + |
204 | [source,vim] | 204 | [source,vim] |
205 | ---- | 205 | ---- |
206 | let g:ycm_language_server = | 206 | let g:ycm_language_server = |
207 | \ [ | 207 | \ [ |
@@ -252,6 +252,15 @@ If it worked, you should see "rust-analyzer, Line X, Column Y" on the left side | |||
252 | 252 | ||
253 | If you get an error saying `No such file or directory: 'rust-analyzer'`, see the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>> section on installing the language server binary. | 253 | If you get an error saying `No such file or directory: 'rust-analyzer'`, see the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>> section on installing the language server binary. |
254 | 254 | ||
255 | === Gnome Builder | ||
256 | |||
257 | Prerequisites: You have installed the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>. | ||
258 | |||
259 | 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. | ||
260 | |||
261 | 1. Rename, symlink or copy the `rust-analyzer` binary to `rls` and place it somewhere Builder can find (in `PATH`, or under `~/.cargo/bin`). | ||
262 | 2. Enable the Rust Builder plugin. | ||
263 | |||
255 | == Usage | 264 | == Usage |
256 | 265 | ||
257 | See https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/features.md[features.md]. | 266 | See https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/features.md[features.md]. |