vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

Please add renaming

Open tinganho opened this issue 10 years ago • 142 comments

It would be very useful if this tool also supported renaming of variables.

tinganho avatar Oct 18 '16 16:10 tinganho

Tip: Just install the vscode-clangd extension (supports "Find all references" too) and set "C_Cpp.intelliSenseEngine": "Disabled", so you can keep using cpptools for debugging.

Get the clangd binary from LLVM: https://llvm.org/builds/

You need a build system, that generates compile_commands.json like cmake or meson, to make this work and adjust settings.json:

    "C_Cpp.intelliSenseEngine": "Disabled",
    "clangd.arguments": [
        "-compile-commands-dir=build"
    ],
    "cmake.configureSettings": {
        "CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
    },

eszlari avatar Apr 01 '19 06:04 eszlari

Vscode, in my humble opinion is probably the best idea (at least free one) on the Linux platform I have spent about 2-3 months trialing everything I can find - like: qtcreator, code-lite, code locks, clion, eclipse (puke), netbeans (really puke) and more... From the point of view of using the idea as a makefile c++ project only qtcreator and code lite come close. Qtcreator is near perfect except they forcefully inhibit you from sharing configs which is unforgivable. Code lite is pretty clunky. But both provide refactoring. So I congratulate vscode ... But this is the biggest missing feature by a looooong way. It should be top priority (as far as c++ goes) please make it so soon : ) … On Thu, 28 Mar 2019, 19:04 Jock Murphy, @.***> wrote: @rtosman https://github.com/rtosman I think they know that. I know I have been fairly critical on this issue, but they are doing great work. I just personally think the priorities are wrong, and that maybe they could communicate a little better on such a highly desired feature. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#296 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AFO85c8hgIQ949dWufrgxPSxy-ypqyn0ks5vbRIrgaJpZM4KaBV5 .

I fully agree, this is one of the basic feature each editor should have. I miss it now as well.. no_action_available

melroy89 avatar Apr 09 '19 21:04 melroy89

One more missing this symbol rename feature.. I will give up on VSCode just because this.. Let's get back to Eclipse..

alexborro avatar Apr 12 '19 13:04 alexborro

I fell in love with this IDE right away and then immediately abandoned VS Code simply because not being able to perform the most fundamental refactoring actions renders it completely useless to me. It's been two and a half years and despite all the comments and support nothing has been done. I'll come back in two years to complain about it again.

bitcharmer avatar Apr 12 '19 19:04 bitcharmer

It looks like it is scheduled for the July update. Could try coming back in 3 months ;-)

rtosman avatar Apr 12 '19 19:04 rtosman

This has been an issue for over 2 years? Really? Really? Is VsCode considered an IDE? #_#

dragos99 avatar Apr 14 '19 12:04 dragos99

@dragos99 That seems to be a matter of opinion. Personally I see an IDE as something that can (out of the box) create projects, edit code, compile/run the code, and debug the code. By that definition VSCode isn't an IDE. However if you don't see creating projects as a requirement, or don't mind mixing and matching plugins to do that task, then it could be seen as one.

Now I don't see the point in using a IDE that doesn't have basic refactoring and analysis tools, but not everyone sees things that way

jockm avatar Apr 14 '19 21:04 jockm

VS Code and its plugin is most definitely an IDE. VS Code and PlatformIO is perhaps the best environment for writing Arduino (and other dev board) code. Not having refactoring is the one annoying thing.

geometrikal avatar Apr 14 '19 22:04 geometrikal

I would trade ALL other possible updates for this one at the moment.

DraTeots avatar Apr 17 '19 02:04 DraTeots

It would certainly make VSCode the killer-IDE on Linux.

nmoinvaz avatar Apr 17 '19 03:04 nmoinvaz

It would certainly make VSCode the killer-IDE on Linux.

Indeed, but hopefully is VSCode not part of embrace, extend and extinguish strategy..

melroy89 avatar Apr 17 '19 12:04 melroy89

It would certainly make VSCode the killer-IDE on Linux.

Indeed, but hopefully is VSCode not part of embrace, extend and extinguish strategy..

danger89, I sincerely doubt it considering that Microsoft has released the source code. They seem to be making an effort to change with the times. As far as why this feature has taken so long, i'm not an expert but I assume that shoehorning a language server into a javascript/electron app is hard.

acestronautical avatar Apr 18 '19 08:04 acestronautical

This is by far the biggest missing feature for C/C++ in VSCode compared to other languages. I'm somewhat surprised it hasn't even been started in 2.5 years. Hoping it comes out in July!

mmcru avatar Apr 23 '19 16:04 mmcru

Just walking by to remind everybody that this is really important :dancing_men:

AvivC avatar May 24 '19 15:05 AvivC

Absolutely would love to have this.

As an aside, with the current way it works can anyone suggest a more efficient way than I do now when I want to rename part of a long symbol name? This is what I do currently:

  1. Select symbol name to be renamed
  2. Invoke Replace in Files (ensuring case and whole word filters are selected)
  3. Copy and Paste symbol name from Search box to Replace box (since I only want to change part of the symbol name)
  4. Now I can edit the symbol name in the Search box
  5. Hit Change All

As it stands, it would help a lot if the Replace box defaulted to the Search contents when a new Search and Replace is begun (Replace box defaults to its previous contents and that is not configurable AFAIK).

Jimbo99 avatar May 24 '19 15:05 Jimbo99

Let's hope we get full refactoring features for C/C++ this year.

melroy89 avatar May 31 '19 01:05 melroy89

I agree this is a missing feature.

However, for this to work, you need 'find all references', aka #15 first, no? Otherwise you would be renaming the wrong things. no?

SO, in my order of importance:

  1. find all references
  2. renaming (the found references)

since 'find all references' is also 3 years+ old, and currently scheduled for this month, I see light at the end of the tunnel.

yamcenutzer avatar Jun 12 '19 13:06 yamcenutzer

ahh, find all references has been moved again

yamcenutzer avatar Jun 14 '19 16:06 yamcenutzer

Yes, we have a bit more work to do on that feature, but are planning to have it ready for Insiders in the first half of July.

bobbrow avatar Jun 14 '19 20:06 bobbrow

I sure wish we had this rename feature in VSCode, because when I try to do it in VS 2017, it sometimes freezes and I have to End Task. I was sure that VSCode would have it. Very disappointed.

ScottHutchinson avatar Jun 24 '19 20:06 ScottHutchinson