From 8a8be062194604360bbb27ee11961b8a72973f44 Mon Sep 17 00:00:00 2001 From: bravomikekilo Date: Fri, 22 Nov 2019 02:51:40 +0800 Subject: initial invert_if --- docs/user/assists.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'docs/user') diff --git a/docs/user/assists.md b/docs/user/assists.md index 8da7578e2..6e7811bd6 100644 --- a/docs/user/assists.md +++ b/docs/user/assists.md @@ -329,6 +329,25 @@ fn main() { } ``` +## `invert_if` + +Apply invert_if +This transforms if expressions of the form `if !x {A} else {B}` into `if x {B} else {A}` +This also works with `!=`. This assist can only be applied with the cursor +on `if`. + +```rust +// BEFORE +fn main() { + if┃ !y {A} else {B} +} + +// AFTER +fn main() { + if y {B} else {A} +} +``` + ## `make_raw_string` Adds `r#` to a plain string literal. -- cgit v1.2.3 From 8d02df93d7ff7cc30a3574d05c7f22b877ebfd67 Mon Sep 17 00:00:00 2001 From: Ashkan Kiani Date: Sat, 23 Nov 2019 01:58:13 -0800 Subject: Add note about neovim's built in language server --- docs/user/README.md | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'docs/user') diff --git a/docs/user/README.md b/docs/user/README.md index bfb190449..f3fdac319 100644 --- a/docs/user/README.md +++ b/docs/user/README.md @@ -132,6 +132,11 @@ to load path and require it in `init.el` ## Vim and NeoVim +Neovim 0.5 has a built in language server. For a quick start configuration of +rust-analyzer, use [neovim/nvim-lsp](https://github.com/neovim/nvim-lsp). +Once `neovim/nvim-lsp` is installed, you can use `call nvim_lsp#setup("rust_analyzer", {})` +or `lua require'nvim_lsp'.rust_analyzer.setup({})` to quickly get set up. + * Install coc.nvim by following the instructions at [coc.nvim] - You will need nodejs installed. - You may want to include some of the sample vim configurations [from here][coc-vim-conf] -- cgit v1.2.3 From ebdde642873d1a33b375d3491f43bdc185e75427 Mon Sep 17 00:00:00 2001 From: Ashkan Kiani Date: Sat, 23 Nov 2019 02:00:38 -0800 Subject: Fix url to point to rust_analyzer specifically --- docs/user/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/user') diff --git a/docs/user/README.md b/docs/user/README.md index f3fdac319..913ecea18 100644 --- a/docs/user/README.md +++ b/docs/user/README.md @@ -133,7 +133,7 @@ to load path and require it in `init.el` ## Vim and NeoVim Neovim 0.5 has a built in language server. For a quick start configuration of -rust-analyzer, use [neovim/nvim-lsp](https://github.com/neovim/nvim-lsp). +rust-analyzer, use [neovim/nvim-lsp](https://github.com/neovim/nvim-lsp#rust_analyzer). Once `neovim/nvim-lsp` is installed, you can use `call nvim_lsp#setup("rust_analyzer", {})` or `lua require'nvim_lsp'.rust_analyzer.setup({})` to quickly get set up. -- cgit v1.2.3 From adac4fc2f21117486356063d82d79f8c3add084a Mon Sep 17 00:00:00 2001 From: bravomikekilo Date: Sun, 24 Nov 2019 13:14:57 +0800 Subject: do refact and fix some issue --- docs/user/assists.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/user') diff --git a/docs/user/assists.md b/docs/user/assists.md index 6e7811bd6..6f4c30bee 100644 --- a/docs/user/assists.md +++ b/docs/user/assists.md @@ -339,12 +339,12 @@ on `if`. ```rust // BEFORE fn main() { - if┃ !y {A} else {B} + if┃ !y { A } else { B } } // AFTER fn main() { - if y {B} else {A} + if y { B } else { A } } ``` -- cgit v1.2.3