... when macros are used in function definition
Task-number: QTCREATORBUG-12314
Change-Id: I811f93cde3dffa75fb71684569706f284939d7f5
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Instead of having two lists of paths, now only one list is used where
both include paths and framework paths can be mixed. This reflects the
way the compiler is invoked, and retains the (correct) search order.
Task-number: QTCREATORBUG-11599
Change-Id: I373953e3e305df5b7a0d10920e12d146584adf9f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
If a variable's name is only "m_" it should not be recognized as a
prefix (resulting in an invalid/empty getter and meaningless setter) but
rather as a name with the "_" postfix. This way, it results in getM()
and setM().
Change-Id: I9a8249fc12319034b95532415f40b6c3183f7754
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
They belong there. This will also kill the CppSourceProcessor dependency
from CppEditor.
Change-Id: Ic2ae6b0c6f0913d913636be61df194846985d1ce
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
...since it does quite a bit more than only preprocessing, as the name
suggests. We use that class to process source files in general. The
output is not a preprocessed source, but a set of CPlusPlus::Documents
with symbols.
Change-Id: I787d0f22f9f042ddf0c99e8c2f0bdb9aa7001735
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This is necessary in order to add tests with multi-byte UTF-8 code
points. Otherwise the initial and target source code marker positions
will be calculated on the QByteArray (test code) but used with a QString
(editor document).
Change-Id: I108961b13d32912a4d3193cf26eb59f65d296f57
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
For example test_quickfix_InsertDefFromDecl_afterClass led to a
QByteArray::remove(-1) call. According to the doc nothing happens, but
it will become problematic later when we change to QString (with that, a
character will be removed from the end).
Change-Id: Ie89dd7834e44fbcfde63ea6ca3ab181dfe50e191
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
removeTrailingWhitespace() appended one '\n' too much. As time went by,
excess '\n' where added to the test code.
* Remove excess '\n'.
* For consistency, ensure that each test code line ends with '\n'.
Change-Id: Ie2d4a1b8b27989f26bf154cb3b891dfb8fe6b2fd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
It contains many components, doesn't make sense to have it with all
other quickfixes.
Change-Id: Idede14c90ba9b612ae9e9048f5795d674811acfe
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
QVERIFY/QCOMPARE are meant to be called in the test function so that on
failure they just can "return" and thus skip subsequent code. Since we
use reusable test code in the test functions (the *TestCase classes), we
need to ensure that on failure no further test code is executed.
This mostly inlines the run function of the test classes into the
constructor.
Change-Id: I320ee032bdde0174ddfe3fdf3f9e18e19abf1d7f
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Move common functionality of the 12 test classes into base classes.
Change-Id: If64d3cec876807ac6f991151189860a99b8ff4ca
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Needed for easier diff for upcoming refactoring...
Change-Id: I779b25d09a03fc1ed54e2ba35946678a5e863265
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
When a class was directly assigned to a variable the definition was
misplaced right after the variable.
Task-number: QTCREATORBUG-10303
Change-Id: I2cdfee784b085d856d7ff5ebe62bf791b9a6754e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Rewrites post increment/decrement operators (++ and --) as pre
increment/decrement operators and moves non string/numeric literals and
non id expressions from loops condition to loops initializer.
Change-Id: Id95334b6df6fcaa9af436cc1d2d0982d38bf8fe2
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Starting with commit 243a625 EditorManager::closeEditors() does not
delete the editors anymore, but calls deleteLater(). When the call
returns, all kind of checks fail since the editor widget destructor was
not yet called.
Fixed by providing and calling Core::Tests::closeAndDeleteEditors(),
which explicitly sends QEvent::DeferredDelete to the widget.
Change-Id: I3287abbe74ccf7d7a18b997a847701c8be17cb55
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This speeds up the quick fix InsertDefFromDecl on function declarations
in classes containing Q_OBJECT.
Task-number: QTCREATORBUG-9877
Change-Id: I0af16f17f40735040b7158a3191c13db3433edf9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Lorenz Haas <lykurg@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Now the used QuickFixFactory InsertVirtualMethods is configured to not
generate any pop ups.
Change-Id: I36d297678d87e6fb2eb0a73fea6384f0eb7e21f0
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
* Affected quick fixes: InsertDefFromDecl, MoveFuncDefOutside
* Fix also reformating pointer declaration of operator functions for
qualified name ids
Change-Id: I6a7578f496221557d103f5fdbb5dacc9540ee779
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Now InsertDefFromDecl finds the right implementation file and the speed
of match() is improved.
Task-number: QTCREATORBUG-9627
Change-Id: Ibff824f52124e8cc10ccb6a97c133e11565473db
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Consequent use of insertLocationForMethodDefinition respects the
surrounding namespace when moving/inserting definitions.
Task-number: QTCREATORBUG-2676
Task-number: QTCREATORBUG-9332
Change-Id: I6d83cf84d844dd4773900d03563581c88befa7b7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
With this patch it is checked if the function/new-expression is used in
a function call or return statement the whole AST down to the
translation unit.
Task-number: QTCREATORBUG-9525
Change-Id: I34b30ee64b9436c9c9d2586c28fd22f148bee892
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>