-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cmds): support snippet text edit #252
Conversation
I'll try it :) Findings:
|
Oh my, this fixes the "select the generated |
For me, checking actions when cursor is over fn main() {
foo();
} Gives fn main() {
foo();
}
fn foo() {
todo!()
} I can see from neovim statusline that after that I enter a coc snippet session, but it's not useful because my cursor is at the end of the code, and there's no placeholder to jump to. |
Happens with set runtimepath^=~/.vim/plugged/coc.nvim
colorscheme peachpuff
let mapleader = ' '
nmap <silent> <leader>cA <Plug>(coc-codeaction)
vmap <silent> <leader>cA <Plug>(coc-codeaction-selected) |
@oblitum do you use the stable or nightly release? stable release will add function foo but without jumping into it. nightly release will bring you into the foo function, and select |
I've tested with this pull + rust-analyzer nightly 42dd0ce.
|
Yes, it's the latest nightly release. This snippet textEdit feature is new in rust-analyzer. |
@TimoFreiberg how do you get |
By writing |
@TimoFreiberg yes, this will trigger |
Oh shit, I misread. |
@TimoFreiberg reproduced. |
@TimoFreiberg Tested with VSCode + RA, will fail to generate function for this example case. rust-lang/rust-analyzer#4551 |
Sorry folks but I couldn't make it work like expected on my side, even with this branch compiled and latest rust-analyzer nightly. Jump to place holder doesn't work. Now on latest coc.nvim things got a bit more non intuitive because it's not showing coc actions for current line anymore and actions for buffer by default, so to even make the create function action to show I have to use coc action with selection. |
@oblitum yes, |
@TimoFreiberg make a fix for generating function issue |
Now the closing brace of the generated function gets selected instead of the Expected:
Actual:
|
This is the behavior I reported. |
rust-lang/rust-analyzer#4494
@oblitum @TimoFreiberg can you guys test this? Maybe you need to download latest nightly release.