Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual studio code refactoring does not seem to work (e.g. rename symbol - f2)

So I have just installed vscode on ubuntu at version: 1.27.2. I have installed the extension for c++ as well.

Its all working nicely, except that I cant seem to use the refactor actions. Specifically I want to use the rename symbol (f2).

When I click a variable and press f2 nothing happens. If I do ctrl+shift+r (refactor actions) I always get "no refactorings available".

I checked the key-bindings and it shows for "f2":

  • Command: Rename Symbol
  • Keybinding: F2
  • Source: Default
  • When: editorHasRenameProvider && editorTextFocus && !editorReadonly

So I checked that the editor is writeable and text has focus - both true. But I am not sure what this editor has rename provider is?

So I need to install something else? - how can I get refactoring working?

Update

This has now been implemented in vscode-cpptools extension: version v0.26 called "rename symbol".

like image 796
code_fodder Avatar asked Nov 01 '18 08:11

code_fodder


1 Answers

Renaming is not currently implemented by the C++ extension, but a preview of the feature will be released next week for our "insiders" (set the C_Cpp.updateChannel setting to "Insiders" to get it).

like image 122
Bob Brown Avatar answered Sep 24 '22 06:09

Bob Brown