Commit Graph

6441 Commits

Author SHA1 Message Date
Christian Kandeler
15a1266d50 clangbackend: Do not handle built-in types specially
... when collecing tooltips. The more general functions provide more
information, such as constness.

Fixes: QTCREATORBUG-14950
Change-Id: I6d0a890a695e19e9754b5538ba092a188a3bbbb0
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-07-06 06:32:33 +00:00
hjk
a2bf75bb55 Debugger: Add test for char * display
Change-Id: I7319ab6c12aab30e58c5b9fd9223534745fa741c
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-07-06 06:20:18 +00:00
hjk
430a33dcd9 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-07-06 06:07:13 +00:00
Christian Kandeler
4c2938a366 Fix qbs build
Change-Id: Ic19d1f42d98a0bec31f2f5788063f6b2e7d61cef
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-03 14:49:01 +00:00
Robert Loehning
9c7a1577a5 Squish: Don't try to "Save All" when there are no unsaved files
Change-Id: I431c9754d84d36f0c09e45e6c43fe67f173da59f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-02 11:16:09 +00:00
Robert Loehning
ef4bc4432a Squish: Update expected output
Change-Id: If5fdc09ee57ab476e7d434f084fffceb82df23cf
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-02 11:15:40 +00:00
Robert Loehning
cc63b3b47a Squish: Update menu items
Change-Id: Ibbca07fb02092ce829246e99b2365b513b1fa4e0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-02 11:15:13 +00:00
Tim Jenssen
6c59ceb6e0 Merge remote-tracking branch 'origin/qds-1.59' into 4.13
Change-Id: Ia5756102fa014a8376c8b277e9a50a112c594d35
2020-07-02 02:05:28 +02:00
The Qt Project
fa81549844 Merge "Merge remote-tracking branch 'origin/qds-1.59' into 4.13" into 4.13 2020-07-01 16:21:30 +00:00
David Schulz
2915ee0832 Core: remove impractical offset member of text position
It is just accessed when getting the length of multiline ranges and in
that case we can pass the string that range is used on to calculate the
real length.

Change-Id: I3fe95ac0cd4b05a08924a5285a75ebc5eed2423b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-07-01 10:51:44 +00:00
Christian Stenger
f5f684a609 Squish: Fix expectation when canceling a clone
Change-Id: I674324a4a98e4329c4445de69ceddeffba607ff3
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2020-07-01 09:59:40 +00:00
Marco Bubke
327bec26bf UnitTests: Temporary disable the tests
I added QmlDesigner to the unit tests but I have no clue have this can work
with CMake. We only want some source files and are preloading some other
header.

Change-Id: Iadf8ca09b7e63055d1e2ff231a15ef7be2891204
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-07-01 09:09:57 +00:00
Thomas Hartmann
a97ea2e3b3 QmlDesigner: Fix test build
Change-Id: Ib24054b9caa1a2b1404c8af7af7f85bc3de1e6b2
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-07-01 08:16:36 +00:00
Tim Jenssen
0c6231d7ec Merge remote-tracking branch 'origin/qds-1.59' into 4.13
Conflicts:
	src/tools/clangpchmanagerbackend/source/pchtaskqueue.h

Change-Id: Ibe8ac2fa0eafcbcc86ac445f0be035839e06ff40
2020-07-01 09:40:01 +02:00
Thomas Hartmann
f9df5b445a QmlDesigner: Fix tests
Change-Id: I74442bf004a462d5d310f128b64f8bc82073d822
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-30 18:47:17 +00:00
Eike Ziller
6a095d6c9a CMake build: Make option to include dumper tests discoverable
Change-Id: I9828f362561b8392d31a56f8a60fe9531accf4ce
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2020-06-30 11:39:44 +00:00
Eike Ziller
7f44d8582b CMake build: Remove timeout for dumper tests
They take much longer, but are also optional.
Makes it possible to run via e.g. "ctest -V -R tst_debugger_dumpers"

Change-Id: I8bbda6ca36e25cd896b1f3be5d1696a27b8acc53
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-06-30 11:39:24 +00:00
Marco Bubke
1e6807c680 QmlDesigner: Add listmodeleditor
Task-number: QDS-2294
Change-Id: I66cae3a0d4265ab112eaf6b04e3a5972d185ff43
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-30 10:28:07 +00:00
Marco Bubke
32e181f5ce ClangRefactoring: Remove not used pch files
Because we use UUID for pch files every time we rebuild a pch we get
a new file. This patch is collecting and removing this pch files.

Change-Id: Ia8688e7215ee7b41f39b2285323eaa345056bda3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-30 09:52:50 +00:00
Marco Bubke
c924a45fb2 Refactoring: Fix unit tests
One if the LLVM 10 hot fixes was not working.

Change-Id: I1e6cab39ffd5c52f55fb83ff777f6eca457dea35
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-30 09:52:42 +00:00
Marco Bubke
36b72e2bab QmlDesigner: Break dependencies
To get the model under unit tests we have to break every depenedency to
code outside of the unit test scope.

Change-Id: Ib613c3308e48990c55b2ed0cd42bc4b0e1041a01
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-30 09:52:34 +00:00
Tim Jenssen
b8cd87dea0 Merge remote-tracking branch 'origin/qds-1.59' into 4.13
Conflicts:
	src/plugins/clangformat/clangformatplugin.cpp
	src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp
	src/plugins/qmldesigner/qmldesigner.qbs

Change-Id: Ie4a0beeb9fd32ac9683f4e8769988a9c3f3e369a
2020-06-26 16:51:22 +02:00
Christian Kandeler
22830fd5e2 Tests: Fix deprecation warning
Task-number: QTCREATORBUG-24098
Change-Id: Icea21e446173537d8fdb8113f1eff7d7176c34b3
Reviewed-by: hjk <hjk@qt.io>
2020-06-26 10:31:18 +00:00
Artur Shepilko
f3c2f68c39 Sqlite: Fix a compiler warning about unhandled switch-case
Change-Id: Id9cb6ebd6db7f718f8aa3e25d56581f953ad182e
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-06-24 15:04:20 +00:00
Volodymyr Zibarov
40173ad4ab C++: Fix auto variable resolving for template class constructor call
Code snippet:
template<class T> struct MyStruct { int value; };
int main() {
    auto s = MyStruct<int>();
    s.value;  // "value" is not found
}

This fixes find usages for unique_ptr declared as auto like this:
auto ptr = std::unique_ptr<MyStruct>(new MyStruct());
ptr->value;

Also fixes in-place constructors:
std::unique_ptr<MyStruct>(new MyStruct())->value;

Fixes: QTCREATORBUG-15364
Change-Id: I8d452a77fe85e63665ec8d4c4afbcf8aad063121
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-06-22 14:27:49 +00:00
Eike Ziller
4a8b3268dd Merge remote-tracking branch 'origin/4.12'
Change-Id: I0935f0087efc1ddd4f17fcafc2e3b5c58c23bef4
2020-06-22 09:33:40 +02:00
Christian Kandeler
f9a5ad4d3c ClangBackEnd: Adapt skipped source ranges from libclang
... so that the first #if is not grayed out.

Fixes: QTCREATORBUG-23714
Change-Id: Ia014fd8cd768ea9530567ba8c712bdc0c4063091
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-19 09:14:24 +00:00
hjk
dd9519b1c4 Debugger: Remove QLinkedList occurrences from manual tests
And restrict the auto test to Qt<6.

Task-number: QTCREATORBUG-24098
Change-Id: Idfbe94bc1a4b2d5a8c23a07a031520775bb17cd3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-18 13:41:56 +00:00
Christian Kandeler
8eac3fba80 CPlusPlus: Fix lexer crash
At some point in the preprocessing stage, some tokens get "squeezed", so
their associated string no longer refers to the document content, but
only to their own symbol. However, there is at least one context that
operated under the assumption that the token's offset still pointed into
the "global" string. As the token's offset is zero after parsing, this
lead to the same piece of code being preprocessed in an infinite loop.

Fixes: QTCREATORBUG-19525
Change-Id: I231ba51811cfa0b5c6dfe7f75fe0384472252c6f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-18 07:52:02 +00:00
Eike Ziller
1b431fe271 Move Id from Core to Utils
And add a compatibility wrapper for Core::Id, so we don't have to rename
all occurrences from Core::Id to Utils::Id.

This allows us to use Id also in Utils, which makes it possible to e.g.
move Core::InfoBar to Utils without work arounds.

Change-Id: I5555d05b4e52f09d501dbfe5d91252a982a97c61
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-06-18 05:58:23 +00:00
hjk
5a7256b4bf Debugger: Start making auto tests work using cmake
Change-Id: Ibe6c9bdfb52a16171e6f6acb841f185d936878f3
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-17 12:15:43 +00:00
Christian Kandeler
5ca17578d5 Tests: Fix Qt 5.15 deprecation warnings
Change-Id: I458cced795f29479557853919bd6d317e5870f07
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-17 10:22:09 +00:00
Robert Loehning
c9355626d5 Squish: Update expected tree for qbs
Change-Id: Ib2fd3ec1df0772de2ae2ef7c4083431ccd32095b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-16 14:17:53 +00:00
Christian Kandeler
0861ba2fc9 sqlite: Fix qbs build
Exporting the full sqlite interface can lead to run-time conflicts with
the system sqlite that Qt's SQL support pulls in.
So re-build the sources for the unit test, as in the qmake build.

Change-Id: I8394b9c0aa4e21704bc84600f40b8f5d706ad66d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-16 12:43:00 +00:00
Marco Bubke
270e7b4ea5 UnitTests: Fix fake project.h
Change-Id: I5bd3be88c900af0caaccf8ca3ba2793f20ccf6f8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-06-16 12:24:28 +00:00
Volodymyr Zibarov
9be4a5f839 C++: Fix Find Usages false positive results for function arguments
Code snippet:
void bar();         // call find usages for bar from here
void foo(int bar);  // bar from here should not be in results

Add test for member function false positives, that is part of
QTCREATORBUG-2176. That was already fixed before.

Fixes: QTCREATORBUG-2176
Change-Id: I9a079caa83bbaea1edb7ba6aeb151d4d4c77952f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-06-15 13:19:51 +00:00
Volodymyr Zibarov
7d82741602 C++: Fix find usage to see Catch test functions bodies
Catch test functions defined with function-like macros.
To speed-up semantic analysis, find usages does not expand function-like
macros.
Semantic fails with "expected a function declarator" on such functions
and skips function body.
To avoid that, we create dummy function type specifically for this case

Change-Id: Ie2f2464ee57aa4dc86eed07b8b699458f95c0266
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-06-15 10:16:06 +00:00
Eike Ziller
8b8ecfa28f Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/cmakeprojectmanager/fileapiparser.cpp

Change-Id: I39f8c2be859be043f506bef77de9bb5b42d38165
2020-06-15 11:30:34 +02:00
Eike Ziller
e2670bf3e6 CMake build: Build tests with relaxed QString casting
Like in the qmake build.

Change-Id: I216649123b4f25e5c01f2a71162fc200e0a36d85
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-12 14:30:08 +00:00
Robert Loehning
70662eeb90 Squish: Don't "Save All" at the end of tst_rename_macros
There are no unsaved files.

Change-Id: Ief078f521a7bf6e257d862b69b8dc003b47da31e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-12 09:42:48 +00:00
Christian Kandeler
11f7c4da9f clangbackend: Fix libclang's priority adjustments
... for member qualifiers.
For instance, when doing completion on a non-const object, non-const
member functions get a higher priority than const member functions. This
does not seem particularly sensible and can make our list of completions
appear unordered.
As each matching qualifier only increases the priority by one and the
base priorities are generally further apart, we can fix this problem by
considering two priorities as equal if they are sufficiently close.

Task-number: QTCREATORBUG-6242
Change-Id: I1d04fdf68869cf07cc00626aaac3030b360c2546
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-12 09:39:57 +00:00
Christian Kandeler
ff348e0dcc Unittest: Fix qbs build
Change-Id: I2f573b820745ecbbf5fc00931b4f96b3d43f634a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-12 09:15:19 +00:00
Robert Loehning
0575e1bbc2 Squish: Fix finding commit
Change-Id: I87d2345babe91c449c20aec8c93dbafee5773d4f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-11 16:22:43 +00:00
Christian Kandeler
aaacfb4945 Fix a clang unit test
This particular test was apparently supposed to check that the two
occurrences of "foo" (one const, one non-const) appear next to each
other in the list of completions. However, there is only one occurrence
of "foo" and the test only succeeded because it happens to be at index 0
and -1 is returned for the second lookup, resulting in a absolute
difference of 1.
So let's explicitly check for that instead.

Change-Id: I6049689911decc114239f2be7e63b091a4a18226
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-11 15:24:07 +00:00
Christian Stenger
7c669a06be Squish: Adapt to changed ui
Change-Id: Ibad3b2080040f7345125c549527f22f2c246fbef
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2020-06-11 13:44:24 +00:00
Tim Jenssen
3acdb7891b Merge remote-tracking branch 'origin/qds-1.59'
Change-Id: I8891e7490a7fd51997a3b57561961f6134be3252
2020-06-11 12:54:10 +02:00
Tim Jenssen
83148cbb89 unittest: another adjustment to new constructor
Change-Id: Id1d38fcca8f4b51dea2c17b466521534b73d7ae7
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-06-10 15:22:08 +00:00
Marco Bubke
50d3067bcd UnitTests: Refactor printing
Move standard printing functions to extra header.

Change-Id: Ib032047235297dfe3ac0bcdbd39c353493f3ae0d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-10 13:34:37 +00:00
Marco Bubke
5a7a6cb02d Sqlite: Remove last usages of UpdateCallback
Change-Id: Ie7ffe06c55a7827fae20996e5b0eadb9892b9e23
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-10 13:34:27 +00:00
Christian Kandeler
4fbd68183b clangbackend: Fix lexicographical sorting of completions
Utf8String has a weird operator<, so we did not get the expected results
from our string comparisons.

Task-number: QTCREATORBUG-6242
Change-Id: I0e94dc42d6e04ab833efcce41463b7024455b6d8
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-10 12:50:50 +00:00