Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: smallB on October 30, 2011, 02:39:57 pm

Title: Simultaneous rename
Post by: smallB on October 30, 2011, 02:39:57 pm
If I have something like:
Code
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.
Title: Re: Simultaneous rename
Post by: frithjofh 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
Title: Re: Simultaneous rename
Post by: smallB 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.
Title: Re: Simultaneous rename
Post by: ollydbg 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)
Title: Re: Simultaneous rename
Post by: smallB on October 30, 2011, 04:15:12 pm
@ollydbg so is there a chance that in near future this feature will get implemented?
Title: Re: Simultaneous rename
Post by: ollydbg 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.
Title: Re: Simultaneous rename
Post by: smallB on November 18, 2011, 11:33:12 am
Thanks, looking forward to see that.