When triggering move or insert definition outside and no other class
symbol is found in the file, the definition is moved or inserted right
after the enclosing Class.
Change-Id: I74ffa872015753ba7372e21b868d3cf7fa49e84a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
For the quick fix AddIncludeForUndefinedIdentifier, if no class is found
via the locator, check the "Qt include paths" for a header file with the
same name as the class name.
Task-number: QTCREATORBUG-9538
Change-Id: I13c86844c2ff653fa479dc91eb109af2a6d76fae
Reviewed-by: Lorenz Haas <lykurg@gmail.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
Now definitions are inserted at the same position inside the
implementation file for MoveFuncDefOutside and InsertDefFromDecl.
Task-number: QTCREATORBUG-9389
Change-Id: If823ffd15ec39a7bc2edb53519380cb9cabb4c55
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Now it is checked if the adjacent declaration is also defined and one
can define the destination file.
Change-Id: Ifff59c49fc2ab3e2f36f41df42ae4b7d7ff8dd35
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
interface is already defined in the Windows 7 SDK headers.
Change-Id: Ic154d45017fc32dca1721f4a0f18456f370bd604
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
...to be consistent with inserting "Outside Class" and "in xxx.cpp".
Change-Id: I32a43153d5d3bdec9fae0be731484a26b108c438
Reviewed-by: Lorenz Haas <lykurg@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
...by detecting include groups (separated by new lines, include types
and same dir prefix).
Task-number: QTCREATORBUG-9317
Change-Id: I73e80fdc715104901cb2d4f5b15b4cab5d04d305
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Do not trigger for functions inside a function call.
Task-number: QTCREATORBUG-9510
Change-Id: I908483fe80ff3ac0f737b21061375e206c1b1d1d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Doing so resulted in an incorrect position for the EOF token when the
preprocessed output would be parsed. That in turn leads to incorrect
insertion positions for refactoring actions.
This is especially true when a file contains only preprocessor
directives: the EOF token would point to line 1 column 1, which is
usually not the place where code should be inserted.
Change-Id: I7d359aa7a6c04bc52c8b873fd49ad6afc3a77319
Reviewed-by: hjk <hjk121@nokiamail.com>
"Add Definition Inside/Outside Class" was wrongly shown when there was
already an definition outside the class.
Change-Id: I6409080c6a1a3abdd4511f7db14ecb4f63458411
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This quick fix inserts (pure) virtual functions of base classes to the
current class. For selecting the functions which should be inserted and
for choosing the insertion mode (only declarations or with definitions
inside, outside or in the implementation file) a dialog is shown.
Task-number: QTCREATORBUG-2210
Task-number: QTCREATORBUG-2692
Task-number: QTCREATORBUG-3908
Task-number: QTCREATORBUG-5868
Task-number: QTCREATORBUG-7982
Change-Id: I8e94905afcae4778986f4c3925a494e0c6b3b8ee
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Includes of moc files are not considered while determining the new
include's position. Further the new include is inserted at its
"alphabeticaly sorted" position.
Task-number: QTCREATORBUG-8871
Change-Id: I67b40a6f538112753298b960da488e24f4643808
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Now one can decide where the new definition should go: Inside the class,
outside the class or to the implementation file. Further the text cursor
is positioned inside the new created definition body.
Task-number: QTCREATORBUG-6973
Change-Id: I593955dd1e44e35240fa1e9b9a5c1a67eb119456
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Adds a local variable which stores the return value of a function call
or new expression.
Task-number: QTCREATORBUG-9052
Change-Id: I1fccbdd5b9f28c8409a4b0fa24610e406de61b24
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
You can write definition of function, type Alt+Enter, as usual,
and select not only public but also other possible sections
like private, public slots and so on.
Change-Id: I2faefc3833c6f05c9e2e5a2a41328bcdbe17ba14
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
With this new operation it is possible to move a function definition
from a cpp file to the header file or vice versa. One can also move a
function definition outside the class body.
Task-number: QTCREATORBUG-516
Task-number: QTCREATORBUG-5364
Change-Id: Id3daefe79284bd9086282369c9d251e003951c11
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Moved content of cppinsertdecldef.(cpp|h) cppcompleteswitch.(cpp|h)
cppinsertqtpropertymembers.(cpp|h) and ApplyDeclDefLinkChanges to
cppquickfixes.(cpp|h).
Made msgQtStringLiteralDescription private member function of
WrapStringLiteral, added anonymous namespace, "extracted" useful
functions to the top of cppquickfixes.cpp.
Change-Id: I4f82a005a62be3c29d4b96902667bd3a2b9397cc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
If there are no includes, add new include at the top of file but skip
possible comments at the beginning.
Task-number: QTCREATORBUG-8799
Change-Id: Ie2be644f6ad0a948cf3d8700efa00087753d9863
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Ran script to remove inludes on a trial-and-error basis and
manually corrected it.
Change-Id: I61a5c2fff02616f6883ddf3923e4361fca6bf92b
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
There were quite a few classes using CPlusPlus namespace in the
CppTools plugin. Rename them and do some other small namespace
related coding style fixups.
Change-Id: I093fc1f3fc394fd9923e3f18d5f66522e288f21d
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
... and adjust INCLUDEPATH accordingly.
while i'm at messing with include statements, also re-order the include
blocks according to policy and sort them within bigger blocks.
Change-Id: I7762abfd7c4ecf59432b99db2f424e4fa25733a5
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
It was restricted to member functions declarations, but works well with
free functions, too.
Change-Id: I8513e67e426185e7e08aebc2f1b5bfd08f79887f
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
- Put declarations into quickfixes.h to simplify testing
- Give the factories more meaningful names
Change-Id: If74c29a8c17819d5369ffa3df94d146b14e53af9
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
- Prefix getter name with 'get' if there is a conflict between
the getter name and the member variable name.
- When possible, use base name of member variable as setter parameter
name instead of 'value'.
- Generate static getters/setters for static members.
- Fix case "class C { char *@s; };" - the quick fix was not offered for
this particular cursor position (right after pointer sign).
- Fix case "class C { char c, *@s; };" - the quick fix was done for the
wrong type (char instead of char *).
- Do not generate a setter for const member variables.
- Do not get triggered on member functions and arrays.
- Do not offer the quick fix if there is already a member with the
getter or setter name we would generate.
Change-Id: I4530467518ea0bf6368e47eb32d5faafbf8cd928
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This does not take namespaces on the implementation side
into account and does not properly position/indent things.
Task-number: QTCREATORBUG-1890
Change-Id: I779d12fefc79521bce38361729d4f66dada71147
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>