Author Topic: Simultaneous rename  (Read 3309 times)

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Simultaneous rename
« on: October 30, 2011, 02:39:57 pm »
If I have something like:
Code: [Select]
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.

Offline frithjofh

  • Regular
  • ***
  • Posts: 373
Re: Simultaneous rename
« Reply #1 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
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Re: Simultaneous rename
« Reply #2 on: October 30, 2011, 03:11:27 pm »
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.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5249
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Simultaneous rename
« Reply #3 on: October 30, 2011, 03:19:36 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.

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Re: Simultaneous rename
« Reply #4 on: October 30, 2011, 04:15:12 pm »
@ollydbg so is there a chance that in near future this feature will get implemented?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5249
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Simultaneous rename
« Reply #5 on: November 18, 2011, 05:55:30 am »
@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.

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Re: Simultaneous rename
« Reply #6 on: November 18, 2011, 11:33:12 am »
Thanks, looking forward to see that.