diff options
author | Seivan Heidari <[email protected]> | 2019-11-25 00:54:54 +0000 |
---|---|---|
committer | Seivan Heidari <[email protected]> | 2019-11-25 00:54:54 +0000 |
commit | 15ea338ac991707d330288ba4d1bf5daa0fc75d9 (patch) | |
tree | 16aeab28bcdb07d36aae28e3fb4a385614865a48 /docs | |
parent | eb7363d167c7a9f7c73cb950b621eb1dce493318 (diff) | |
parent | f7f9757b6b144385ab8ce57b15764473b1f57331 (diff) |
Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into feature/themes
Diffstat (limited to 'docs')
-rw-r--r-- | docs/user/README.md | 5 | ||||
-rw-r--r-- | docs/user/assists.md | 19 |
2 files changed, 24 insertions, 0 deletions
diff --git a/docs/user/README.md b/docs/user/README.md index 235676850..1b2d98608 100644 --- a/docs/user/README.md +++ b/docs/user/README.md | |||
@@ -141,6 +141,11 @@ to load path and require it in `init.el` | |||
141 | 141 | ||
142 | ## Vim and NeoVim | 142 | ## Vim and NeoVim |
143 | 143 | ||
144 | Neovim 0.5 has a built in language server. For a quick start configuration of | ||
145 | rust-analyzer, use [neovim/nvim-lsp](https://github.com/neovim/nvim-lsp#rust_analyzer). | ||
146 | Once `neovim/nvim-lsp` is installed, you can use `call nvim_lsp#setup("rust_analyzer", {})` | ||
147 | or `lua require'nvim_lsp'.rust_analyzer.setup({})` to quickly get set up. | ||
148 | |||
144 | * Install coc.nvim by following the instructions at [coc.nvim] | 149 | * Install coc.nvim by following the instructions at [coc.nvim] |
145 | - You will need nodejs installed. | 150 | - You will need nodejs installed. |
146 | - You may want to include some of the sample vim configurations [from here][coc-vim-conf] | 151 | - You may want to include some of the sample vim configurations [from here][coc-vim-conf] |
diff --git a/docs/user/assists.md b/docs/user/assists.md index 8da7578e2..6f4c30bee 100644 --- a/docs/user/assists.md +++ b/docs/user/assists.md | |||
@@ -329,6 +329,25 @@ fn main() { | |||
329 | } | 329 | } |
330 | ``` | 330 | ``` |
331 | 331 | ||
332 | ## `invert_if` | ||
333 | |||
334 | Apply invert_if | ||
335 | This transforms if expressions of the form `if !x {A} else {B}` into `if x {B} else {A}` | ||
336 | This also works with `!=`. This assist can only be applied with the cursor | ||
337 | on `if`. | ||
338 | |||
339 | ```rust | ||
340 | // BEFORE | ||
341 | fn main() { | ||
342 | if┃ !y { A } else { B } | ||
343 | } | ||
344 | |||
345 | // AFTER | ||
346 | fn main() { | ||
347 | if y { B } else { A } | ||
348 | } | ||
349 | ``` | ||
350 | |||
332 | ## `make_raw_string` | 351 | ## `make_raw_string` |
333 | 352 | ||
334 | Adds `r#` to a plain string literal. | 353 | Adds `r#` to a plain string literal. |