News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Simultaneous rename

Started by smallB, October 30, 2011, 02:39:57 PM

Previous topic - Next topic

smallB

If I have something like:
template<class Int_T,class Int_Y>
auto operator+(const Int<Int_T>& left, const Int<Int_Y>& right)
->Int<typename if_<!std::is_same<Int<Int_T>,Int<Int_Y>>::value,
                  Choose_Larger<Int<Int_T>,Int<Int_Y>>,
                  Promote<Int<Int_T>>
                 >::type
    >
{
   return add(left,right);
}

And I decided that for clarity I would like to change Int_T to simply A and Int_Y to just B I see that at the moment those references are being "highligted" but I don't think I can do anything with those multiple selections? Is there a way that I just select one (the other ones are get highlighted) and I change just this one I've selected and the other ones are get automatically changed?
Thanks.

frithjofh

Hi,

in the editor, using a right mouse click, there appears a context menu. It has a point called "code refactoring -> rename symbols". I use it in cases I want to change the name of some variable, class, function or else across a project ...

regards

frithjofh
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

smallB

Hi nausea, yes that indeed works. But I think that being able to actually change/rename modify this symbol without actually going to some specific menu would be even nicer.
Definitely having this symbols highlighted is somewhat a clue to a user that multiple action is possible at this time. And I think it would be really useful if one could just start typing/deleting chars and the other would automatically get updated.
Thanks.

ollydbg

Quote from: nausea on October 30, 2011, 02:46:27 PM
Hi,

in the editor, using a right mouse click, there appears a context menu. It has a point called "code refactoring -> rename symbols". I use it in cases I want to change the name of some variable, class, function or else across a project ...

regards

frithjofh
To be note:
the "rename symbols" does not works 100% correctly in any cases, because our CC does not do a full parsing. (We don't have preprocessor, semantic analysis in our cc's parser)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

smallB

@ollydbg so is there a chance that in near future this feature will get implemented?

ollydbg

Quote from: smallB on October 30, 2011, 04:15:12 PM
@ollydbg so is there a chance that in near future this feature will get implemented?
I think I can't implement this feature, but I hope than either GCC or clang will supply such feature. So, we can directly use their functionality.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

smallB

Thanks, looking forward to see that.