Refactoring to change return type?
Is there a refactoring for C++/Objective-C++ code to change a methods return type?
I've just tried to change the signature from
static CDebugManager *Instance()
to
static CDebugManager &Instance()
but after invoking "Refactor signature" and hitting 'Refactor' nothing at all was changed.
Any hints appreciated!
Cheers,
Jay
请先登录再写评论。
Jay, there is no such a refactoring at the moment, please follow this issue and feel free to leave additional comments.
Jay, we also couldn't reproduce the issue with changing signature of return type from pointer to a reference. If you have sample project, please create a separate issue in the tracker and attach the sample there.
Hmm, happens every time for me.
I'll create an issue with a simple C++ sample project.
Cheers,
Jay
Please try refactoring this method from string * to string & - the void parameter appears to be the crucial bit breaking the refactoring!
string * TestStuff( void )
{
static string test = "TEST";
return &test;
}
Cheers,
Jay
Hi Alex,
In addition to the refactoring bug where it doesn't refactor anything even in cases where the refactoring works it's barely a find and replace operation..
All usages of the method are broken, i.e. for the example
string * TestStuff( void )
after refactoring all invocations of obj.TestStuff()->size() remain the same and have to be converted to obj.TestStuff().size() manually.
Cheers,
Jay
Thank you for the samples, we've reproduced the issue:
http://youtrack.jetbrains.com/issue/OC-9038
http://youtrack.jetbrains.com/issue/OC-8670
Awesome, thanks!
Can't wait for the fix :-)
cheers,
Jay