Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
Qt Creator 15.0.0-beta2
-
None
-
-
07da22270 (master)
Description
I really like the lightbulb feature, that helps renaming parameter names in functions/methods.
What I do not like is, that it breaks formatting of the parameter listing of the function declaration or definition (depending on what to adapt to).
Starting point:
#include <QDebug> // declaration void foo( int i, float f ); // definition void foo( int i, float f // put the cursor on 'f' ) { qDebug() << i << f; } int main() { foo(1, 2.); }
Now put the cursor on 'f' and choose Context-Menu => Refactor => Switch with Previous Parameter". The result is ok.
Now click on the lightbulb to "Apply Changes to declaration".
This refactoring leaves the declaration in an ugly shape.
#include <QDebug> // declaration void foo( float f , int i); // definition void foo( float f, int i ) { qDebug() << i << f; } int main() { foo(1, 2.); }
So, in the declaration I would have expected to just see the lines switched:
// declaration void foo( float f, int i );
As the declaration is typically in another file you would have to switch to the file and fix the formatting.
Attachments
Issue Links
- clones
-
QTCREATORBUG-31293 Lightbulb "Apply Changes to definition / declaration" changes line breakage
- Closed