Details
-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
Qt Creator 2.8.0-beta
-
None
-
a6c8158484931c41e026b265297a1f2ae8a6e2c7
Description
The extract method refactoring is great, but often I realize that two sections of code are duplicated except for some constant. I'd like to highlight some constant value in a function and have qt creator create a function parameter and update all current uses of the function to call with that parameter. (or alternatively make the parameter default)
example:
bool searchFor(list foo) { for(auto it = foo.begin...) if(it == 7) return true return false; }
becomes
bool searchFor(list foo, int NewParam) { for(auto it = foo.begin...) if(it == NewParam) return true return false; }
Attachments
Issue Links
- relates to
-
QTCREATORBUG-25103 Allow extracting a constant as local const variable or enum
-
- Closed
-
- resulted in
-
QTCREATORBUG-25104 "Extract constant as parameter" quickfix should allow immediate renaming
-
- Closed
-