Commit Graph

918 Commits

Author SHA1 Message Date
Christian Kandeler
d65ef60ea2 clang: Fix include/resource dir confusion
The getClangResourceDirAndVersion() function in ClangTools could return
the actual resource dir or the include dir, depending on the input. This
mistake happened because of misleading names spread all around the code.
Now the function returns what it says, and the other names are accurate
as well.

Change-Id: I0a8600857ee7b9fafb16256e0d1ad203ac3273d2
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-08-24 10:18:30 +00:00
Eike Ziller
2a05186194 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	CMakeLists.txt

Change-Id: I799060da2cb299bb0c49a3da3530fad18427a23c
2020-08-21 10:08:55 +02:00
Cristian Adam
d6c3846ab1 CMake Build: Add Google Testing 1.10.x as submodule
Fixes: QTCREATORBUG-24510
Change-Id: I763d72524f2e581671e18bcd9cda42d5bf7bccdf
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-08-19 15:50:37 +00:00
Eike Ziller
058f1e6918 Fix some license headers
Missing the GPL part.

Fixes: QTCREATORBUG-24501
Change-Id: I9e8e033399c050af29927d0ee735f9bcd05345bf
Reviewed-by: hjk <hjk@qt.io>
2020-08-19 07:05:55 +00:00
Eike Ziller
0c4135e380 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	src/plugins/android/androiddeployqtstep.cpp

Change-Id: Id624bad384050d567efba0700046331086cb12dd
2020-08-13 13:28:33 +02:00
Tim Jenssen
4fe5b923cd Merge remote-tracking branch 'origin/qds-1.59' into 4.13
Change-Id: Ic720f3adab305c5ef8cd10e713ccabf510eff0c0
2020-08-13 06:39:40 +00:00
Christian Kandeler
7938320291 TextEditor: Introduce shortcut for forcing a function hint proposal
... and support it in the ClangCodeModel.
This allows users to get function signature(s) displayed regardless of
where exactly the cursor is on the function call.

Fixes: QTCREATORBUG-19394
Change-Id: I033e8774db93680bfc3ee52610b817e0ef8ccc76
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-08-11 10:10:08 +00:00
Eike Ziller
3944162039 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/cmakeprojectmanager/cmakebuildstep.cpp
	src/plugins/cmakeprojectmanager/cmakebuildstep.h
	tests/auto/debugger/tst_namedemangler.cpp
	tests/auto/qml/codemodel/check/tst_check.cpp

Change-Id: Iefd5f71c03c0078513b76a92af764a4fb22ee4c2
2020-08-10 15:56:54 +02:00
Marco Bubke
b5d59c75a7 QmlDesigner: Fix bool handling in the list model editor
Task-number: QDS-2581
Change-Id: I47a9ed4ca55532bb7199a6c5dd4894b7adb7d05d
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-08-10 09:40:34 +00:00
Marco Bubke
b4027b7943 QmlDesigner: Fix crash for list view model
There was a type, so it crashed. The code is now under tests so we cannot
break it anymore.

Task-number: QDS-2563
Change-Id: I81426a9f8a568b217b7bf9c8c261b24be14ff61a
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-08-10 09:40:26 +00:00
hjk
52b2ca55c9 Replace QT_USE_FAST_{OPERATOR_PLUS,CONCATENTION} by QT_USE_QSTRINGBUILDER
QT_USE_FAST_CONCATENATION doesn't do anything nowadays.

Using QT_USE_QSTRINGBUILDER is the same as QT_USE_FAST_OPERATOR_PLUS
for QStrings and enables more QStringBuilder use for QByteArrays.

Change-Id: Ibd297817c50d86661d47822799f989447249af1b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-08-07 12:45:03 +00:00
Orgad Shaneh
61601899db UnitTest: Fix escaping of LLVM output on Windows
Complements 1929c38a9f.

Change-Id: I95e32baf477e42003f1e97c73fd557b480de33a7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-08-07 05:01:04 +00:00
Christian Kandeler
c24320123b qbs build: Fix spurious re-resolving
The pluginjson module records the VCS state by default, which means qbs
re-resolved the project after every git action. Prevent that.

Change-Id: I24cf1d658ba847b327be018749806856a6e7da1b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-31 08:13:40 +00:00
Christian Kandeler
cf20d44b4a qbs build: Make unittest work with sanitizers
Change-Id: Ie6153a4505f42a1c9754d6af951c72df0065ec1c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-28 13:33:51 +00:00
Cristian Adam
3b8f51391b UnitTests: Re-enable CMake unittests
Ammeds 327bec26bf

Change-Id: I34b62532da424b3b4fb0290049150f6ba444283b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-07-24 10:05:45 +00:00
Christian Kandeler
56de884159 unittest: Fix build
Amends 2915ee0832.

Change-Id: Iea6c76d33046e9c671a9bfb71ad752b1f2501ec4
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-07-13 11:23:50 +00:00
Christian Kandeler
4aba3da7bd CompilationDatabase: Fix unit test
Amends be97943372.

Change-Id: Ic840f5eca8a83b5bdf3e3864e8859234472911b7
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-07-10 12:57:45 +00:00
Eike Ziller
d400dce35d Require GCC 7 and enable C++17
Fix MSVC2019
- result type of conditional expression is ambiguous:
  types 'const char [1]' and 'QByteArray' can be converted
  to multiple common types

Fix MinGW 8.1
- undefined reference to SemanticHighlightNotification::methodName

Fix Utils::transform with std::vector for GCC & MSVC

Unfortunately we cannot get rid of the special variant and optional
implementations, because Apple Clang requires deployment target >= 10.14
for the functions that can throw std::bad_optional_access.

Fixes: QTCREATORBUG-20520
Change-Id: I5c36a70f21f8b0215d2f4fc5c0653a022778d928
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-07-10 11:52:24 +00:00
Eike Ziller
10fd921e26 Merge remote-tracking branch 'origin/4.13'
Change-Id: I4240608a7a0529bb2f6612ba84abae46166458f5
2020-07-10 08:02:27 +02:00
Christian Kandeler
782ca5d8d8 Clang: Fix error when including float.h with mingw
Prevent mingw from trying to #include_next a private header from a path
we cannot add to our list of includes.

Fixes: QTCREATORBUG-24251
Task-number: QTCREATORBUG-24027
Change-Id: I18a9db130b9c2265cd208c3506d08d2e1c4cee45
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-07-09 17:24:16 +00:00
Marco Bubke
b73ce9eccf QmlDesigner: Add row move up and move down buttons
Task-number: QDS-2294
Change-Id: Ia1e64d0811f55151dfe529db4868821840a8fba9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-07-08 09:17:41 +00:00
Marco Bubke
7504c966bf QmlDesigner: Move code from list editor dialog to model
And add tests to the code.

Change-Id: I9fb183729c716a50bbab861d207a212ff704ee7b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-07-08 09:17:26 +00:00
Eike Ziller
1de74cceab Merge remote-tracking branch 'origin/4.13'
Change-Id: I015bac0cccdf466a923c706abdedd8bd8800b0cd
2020-07-06 10:30:54 +02:00
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
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
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
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
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
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
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
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
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
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
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
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
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
Tim Jenssen
bca0c2c3f4 clangrefactoring: fix cmake and qbs after file rename
Change-Id: Ic78df938ad4edced664ef968d834c59110f4ab37
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-06-10 11:32:30 +00:00
Marco Bubke
acf5329422 Sqlite: Fix null handling
Most of it is only silencing a warning but one is fixing a faulty test. So
writing null values should now be working.

Change-Id: If702e1fc8176a9e0ae82a5589c719d567929202b
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-10 09:05:00 +00:00
Marco Bubke
06866c3ee9 Sqlite: Use a more efficient update hook
Change-Id: Ic6df1f4ba6b914c7751faf7cf89083fa50a92793
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-09 14:48:27 +00:00
Cristian Adam
be339abb16 CMake Build: Fix unittests
Change-Id: I4214954d880d19dbe9a070d031c417dc3caf068a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-06-09 12:44:29 +00:00
Eike Ziller
c644e7c80a Merge remote-tracking branch 'origin/qds-1.59'
Conflicts:
	src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp
	src/plugins/qmlpreview/qmlpreviewconnectionmanager.cpp

Change-Id: Ifa7c66330c1995378280cdb4c57c30015dc11b68
2020-06-08 16:04:15 +02:00
Tim Jenssen
42cad89708 fix tests
Change-Id: I5a0f10e6afb85dc0306e224710d2c103f24404f3
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-08 13:02:40 +00:00