[Question] What is the best way to use VS Code's built in refactoring in vscode-neovim ?
See original GitHub issueIn normal VS Code you need to select some code to get the lightbulb to appear that tells you what refactoring is available for that code.
In this extension:
- If I enter visual mode and select code then the lightbulb does not appear until I
ctrl+shift pto transfer the Neovim selection into VS Code - I can then select ‘refactor’ in the menu
- If I select more lines of code in visual mode then the selection as far as VS Code is concerned is lost, and I need to
ctrl+shift pagain to get to select refactor
Am I missing some obvious shortcut or easier way to do things? Could visual mode communicate with VS Code and show the lightbulb and allow ctrl+shift r as insert mode does for refactoring?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Refactoring source code in Visual Studio Code
Select the source code you'd like to extract and then click on the lightbulb in the gutter or press (Ctrl+.) to see available...
Read more >Integrating VSCode With Neovim
Copy the content of your file inside Neovim. Execute the command in Neovim. Sync the results back to Visual Studio Code. This means...
Read more >How to Refactor Code in Visual Studio Code
1. Refactoring with Visual Studio Code Shortcuts · Go to definition: Opens up a pane that shows you where the function has been...
Read more >vscode-neovim/vscode-neovim: Vim-mode for VS Code ...
This extension uses a fully embedded Neovim instance, no more half-complete VIM emulation! VSCode's native functionality is used for insert mode and editor ......
Read more >An Intro to Vim for People Who Use Visual Studio Code
Plugin System. Vim by itself is pretty barebones. · Intellisense. The auto-completion system (Intellisense) in VSCode is arguably its best ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Cheers!
It works but is clunky. It seems to forget when in visual block mode that other lines are selected after the first run. While many are selected on screen it is only acting on one.
Maybe I am just muddling up what VS Code can offer refactoring for with and without selecting code. It is acting funny somewhere, not sure if it is this plugin or Code itself.
I will forget it for now, many refactors are selectble in normal mode. Maybe someone might find it useful or improve it:
Can use
xnoremap <C-R> <Cmd>call VSCodeNotifyVisual('editor.action.refactor', 1)<CR>