Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
Qt Creator 12.0.2, Qt Creator 13.0.2, Qt Creator 14.0.0-rc1
-
None
-
-
768494b61 (15.0)
Description
I really like the lightbulb feature, that helps renaming parameter names in functions/methods.
What I do not like is, that it changes 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 ) { qDebug() << i << f; } int main() { foo(1, 2.); }
E.g., when I rename the second parameter "f" in the declaration to "f1" then a lightbulb pops up and asks me if I want to "Apply changes to definition". Clearly, I want this.
But look at the result:
#include <QDebug> // declaration void foo( int i, float f1 ); // definition void foo(int i, float f1 ) { qDebug() << i << f1; } int main() { foo(1, 2.); }
In the definition the parameter was changed to f1 and the places where it is used in the function were adapted, too. Great!
But, the formatting of the definition changed:
before:
// definition void foo( int i, float f ) { qDebug() << i << f; }
after:
// definition void foo(int i, float f1 ) { qDebug() << i << f1; }
This breaks the original parameter listing formatting.
I would expect to have the result:
// definition void foo( int i, float f1 ) { qDebug() << i << f1; }
In the current behavior, every time I have to go the definition (normally in another file) and change the formatting back. This is tedious.
It would be great if the formatting of the adapted parameter listing would be kept.
Attachments
Issue Links
- is cloned by
-
QTCREATORBUG-31931 Lightbulb "Apply Changes to definition / declaration" breaks lines for "Switch with Previous/Next Parameter"
- Closed
For Gerrit Dashboard: QTCREATORBUG-31293 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
600298,2 | CppEditor: Do not remove newlines in "apply signature changes" | 15.0 | qt-creator/qt-creator | Status: MERGED | +2 | +1 |