Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you rename functions in Visual Studio Code for C++?

Does Visual Studio Code (VSC) have a genuine renaming feature for C++? I know I can replace strings, but this causes errors when I try to rename a function whose name is an infix of another function.

This feature does exist for other languages in VSC and Visual Studio 2017 (which I used before) does come with it, too. I moved from Visual Studio to VSC for my little project because I need a terminal window and I prefer having it within the mainwindow of my IDE.

I'm using VSC 1.12.2

like image 552
Jersey Avatar asked Jan 20 '18 12:01

Jersey


2 Answers

Finally renaming was implemented in C/C++ extention the version 0.26.0-insiders

like image 166
P. Dmitry Avatar answered Oct 28 '22 16:10

P. Dmitry


Unfortunately, you cannot. However, as of writing this it is the second most upvoted feature request in the vscode-cpptools plugin. The most upvoted feature request happens to be an improved find all references feature which works across translation units. Since 'find all references' is a prerequisite for renaming/refactoring we will hopefully see something soon.

like image 41
sciencectn Avatar answered Oct 28 '22 16:10

sciencectn