Skip to content

After code-action similar <c-o> #1328

@A4-Tacks

Description

@A4-Tacks

Reproduction:

fn main() {
    1+1;
}

visual selected range:

fn main() {
    |1+1|;
}

input <F3> open code-action list, select 7. Extract into variable

fn main() {
    let var_name = 1+1;
}

input k move up cursor, unexpected enter insert mode

What's the output of :CocInfo

## versions

vim version: VIM - Vi IMproved 9.1 9011362
node version: v23.9.0
coc.nvim version: 0.0.82-13d0416 2025-07-31 16:32:31 +0800
coc.nvim directory: /home/lrne/.vim/plugged/coc.nvim
term: dumb
platform: linux

## Log of coc.nvim

2025-08-22T16:32:08.892 INFO (pid:20940) [plugin] - coc.nvim initialized with node: v23.9.0 after 395
2025-08-22T16:32:08.895 INFO (pid:20940) [services] - LanguageClient Json language server state change: stopped => starting
2025-08-22T16:32:08.911 INFO (pid:20940) [language-client-index] - Language server "json" started with 20959
2025-08-22T16:32:09.057 INFO (pid:20940) [services] - LanguageClient Json language server state change: starting => running
2025-08-22T16:32:09.071 INFO (pid:20940) [services] - service json started
2025-08-22T16:32:14.088 INFO (pid:20940) [attach] - Request action: stopCompletion [ '' ]
2025-08-22T16:32:15.145 INFO (pid:20940) [attach] - receive notification: startCompletion [ {} ]
2025-08-22T16:32:16.493 INFO (pid:20940) [attach] - Request action: stopCompletion [ 'confirm' ]
2025-08-22T16:32:19.235 INFO (pid:20940) [attach] - Request action: stopCompletion [ '' ]

What's the output of :CocCommand rust-analyzer.serverVersion

[coc.nvim] rust-analyzer 1.91.0-nightly (040a98a 2025-08-20)

What's your coc-rust-analyzer version? You can get it from :CocList extensions

* coc-rust-analyzer 0.84.0 ~/.config/coc/extensions/node_modules/coc-rust-analyzer

Extra configs:

coc-settings.json :

{
    "rust-analyzer.updates.checkOnStartup": false
}

mini-vimrc.vim (vim -Nu mini-vimrc.vim) :

colorscheme habamax

set nu
set laststatus=2
set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P
set statusline^=%(%1*[%{coc#status()}%{get(b:,'coc_current_function','')}]%*\ %)

call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim'
call plug#end()

inoremap <silent><expr> <cr>
            \   coc#pum#visible() ? coc#pum#confirm()
            \ : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
inoremap <silent><expr> <tab> coc#pum#visible()
            \   ? coc#pum#next(0)
            \   : coc#refresh()
xmap <F3> <Plug>(coc-codeaction-selected)
nmap <C-k> <Plug>(coc-diagnostic-prev)
nmap <C-j> <Plug>(coc-diagnostic-next)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions