Commit Graph

6116 Commits

Author SHA1 Message Date
Andre Hartmann
2df71c5798 Lexer: Support the integer suffixes LU and LLU also
Before we only supported UL and ULL.

And add tests for all variants of allowed integer suffixes.

Fixes: QTCREATORBUG-25604
Change-Id: Id92f371d2effa7456d2d50891a6c29810c5c4c75
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-04-19 09:16:55 +00:00
Christian Kandeler
f307c55eac ClangBackEnd: Fix mis-detection of operator<
Inside the body of a function template, clang reports a different cursor
type for operators in some cases. Make sure we don't mistake such
operator< or operator> as opening or closing a template, respectively.

Fixes: QTCREATORBUG-25596
Change-Id: Ifc357e199ea13e44ac501613639e667c333d48e3
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-04-19 07:51:24 +00:00
Christian Kandeler
c80c724b52 ClangCodeModel: Fix template highlighting bug
We need to take into account that the ">>" in constructs such as
std::vector<std::pair<int, int>> is only one token on the clang side.

Change-Id: I90f002ca56f236032f6d39c338593a2ff7590061
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-04-16 07:02:19 +00:00
Marco Bubke
76bd140c7c UnitTests: Fix flaky test
ImageCacheGenerator.CleanIsCallingAbortCallback was not waiting for the
expected call.

Task-number: QTCREATORBUG-25580
Change-Id: I43265389a36e568dea7c7ece5524ef597232d049
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-15 12:05:20 +00:00
Christian Stenger
915b9d0e31 DumperTests: Ensure a set up environment
For whatever reasons the qmake call already needs an
environment containing cl on Windows if QC and the auto
tests have been built with cmake.

Change-Id: I7b55fb792d3bc282cc1561e8e3b55885a25bcf0e
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-04-14 13:49:43 +00:00
Christian Kandeler
98012fb89d Unit test: Fix qbs build
Change-Id: I6046fe9b99e288dcd14a763bce9c337ab45c2eb5
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-30 11:15:09 +00:00
David Schulz
33359883f2 Fix qbs unittest build
Change-Id: Ifb7f564217921c9907dd7e300bc1c31ad7ae1536
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-03-30 10:25:00 +00:00
Marco Bubke
710b96cc89 Sqlite: Value can now handle blob too
This can be quite handy if we want to handle images in the database
dynamically.

Change-Id: I76b87d6b59e999b043bb2335192c90a371187431
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-03-30 07:30:08 +00:00
Marco Bubke
393c65e34e Sqlite: Use std::byte
Change-Id: Ie5bdbae67f7d0f9e533ad20ddb66d03057df2028
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-03-30 07:30:02 +00:00
Marco Bubke
7785a3a651 Sqlite: Move result count to class declaration
It move the magic number of column results to the sql statement
and improves the mock a little bit.

Change-Id: I101067444cf27ec5dea0c72de7fd484a7e8710f0
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-03-26 12:24:37 +00:00
Eike Ziller
62011851ae Merge remote-tracking branch 'origin/4.14' into 4.15
Change-Id: Ie467c5d63420041a9acffeb4a726130988ec0f41
2021-03-18 09:29:51 +01:00
Christian Stenger
da53e3f994 Squish: Allow automatically created kits
Linking to Qt makes the respective configured kits become
auto detected and these have a fixed Qt.
The Qt version combo box for these kits is disabled on the
Kits page, so be more relaxed when checking kits page.

Change-Id: Ieb7e22b47bd5e5c5603e85dc0ddf2421427e85d6
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2021-03-16 07:11:26 +00:00
Christian Stenger
412b661672 Squish: Correct hitting "Do Not Show Again"
Original implementation just made it work for the common use case.
If the order or the selected buttons differed from the common case
this failed.
Beside this it is later on more easily to extend.

Change-Id: I581b0af2579fa728a81b9946028ade5559f17fd8
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2021-03-16 07:10:53 +00:00
Robert Löhning
2ec094b419 Squish: Prepare for clang > 9
Change-Id: I4cf6e8be63568d56388b0cf87ae692735bf4c113
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-15 09:53:55 +00:00
Christian Stenger
2b5f7316ac Tests: Work around problems in execution of dumper tests
On several machines the QDir test interferes in a not yet known
way and makes all following tests fail. Moving it to the end
makes the problem vanish.

Change-Id: Ic8e7fdaaf9581be0cdd5666c7d2f12a2e8ed80ee
Reviewed-by: hjk <hjk@qt.io>
2021-03-11 09:05:04 +00:00
hjk
b4de69795f Debugger: Mark elision of long QUrls in Locals and Expressions
Fixes: QTCREATORBUG-25404
Change-Id: Ieee42f9239c9ffe88da03765678e1d2c4b6bb11d
Reviewed-by: David Schulz <david.schulz@qt.io>
(cherry picked from commit 6df27ccbe7)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-03 08:25:25 +00:00
Eike Ziller
eaa4592b63 Merge remote-tracking branch 'origin/4.14' into 4.15
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: I892ea0c3b42f61b9cd24fa5508ec181d8d245d29
2021-03-01 09:49:45 +01:00
Christian Kandeler
a995a4633f CPlusPlus: Do not mis-classify bitfield declarations as initializations
Fixes: QTCREATORBUG-25390
Change-Id: I1976b7db2996f5a09db73adbd127aac9ab92d57d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-25 15:55:54 +00:00
Christian Stenger
de04f29198 Squish: Wait for the docs update progress bar
Change-Id: I73e80119a7e5a8d09397138d1301154af597f907
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2021-02-25 08:02:37 +00:00
Fawzi Mohamed
c0f9f29097 qmljs: correctly reformat js spread operator (...)
Fixes: QTCREATORBUG-23402
Change-Id: I6b4bd0846dac67116711b7ed046bd52d137b7674
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-23 12:38:55 +00:00
Eike Ziller
768d4321f9 Merge remote-tracking branch 'origin/4.14'
Change-Id: I214b8d59e8ff7fe0511cd6116ec7725ddc4376ee
2021-02-18 09:26:22 +01:00
hjk
34945f84e4 Debugger: Use a class for GdbMI parser parameters
Currently only the previous from/to pair, but can be extended
by codec state.

Task-number: QTCREATORBUG-24462
Change-Id: I3d101e74d1fef65bb75ddaab1dc2eaf77201dcde
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-18 06:07:36 +00:00
Christian Kandeler
dfa24f09ad ClangCodeModel: Show only valid applicable overloads when completing
libclang is smart enough to filter the overloads according to which
arguments have already been entered, so let's make use of that.

Fixes: QTCREATORBUG-650
Change-Id: Ic2711f460c908c6fd9c8efe28c3c63a0ce2d9205
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-17 07:09:37 +00:00
hjk
9c9ca280ea Debugger: Add some manual test to check console interaction
Change-Id: I02a87657f5be1c4ba8ab8921d0d015a8f34df0af
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-17 06:31:02 +00:00
Christian Kandeler
74177a559e clangbackend: Work around libclang cursor bug
... involving accessing the member of a nested anonymous union from
within the surrounding class. libclang reports a CXCursor_CXXThisExpr
for this location instead of a CXCursor_MemberRefExpr. However, the
latter is still locatable in the AST, so we can correct this.

Fixes: QTCREATORBUG-25342
Change-Id: I1eba13d5153205a52b3689d8ad52493a56b76c07
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-15 12:18:36 +00:00
Marco Bubke
e3d12e659a Sqlite: Add readTo method
There are cases when you want to read to an already existing container.
This will prepare for the RETURNING extension in the next Sqlite version
where you can write and read. That will simplify quite some code.

Change-Id: I740ffbedecf72bb5518392f3707a0a6b2221db56
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-15 10:39:45 +00:00
Marco Bubke
18fe4233f8 Sqlite: Add callback method
Sometimes it is better to have a callback instead of returning a container.
The call has to manage the state if an exception is called but otherwise
it will reduce the memory footprint. There will be to a RETURNING
to Sqlite which will read back values as you write.

Change-Id: I7eb49850e2c76f883a03277b31c5e713e9774c92
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-15 10:39:30 +00:00
Christian Kandeler
5f5f38e028 ClangCodeModel: Support "parentheses" matching for ternary operator
That is, show which ":" belongs to which "?" when the cursor is on one
of them.

Fixes: QTCREATORBUG-1410
Change-Id: Ie19360b3dfc82d92c264d99a5aa1864eda66e5c8
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-11 08:52:17 +00:00
Christian Stenger
ec9a72808f Tests: Fix pluginspecs test for cmake
Change-Id: I700bd9cbcdabfa08863ffb727a084a9339e660d5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-10 05:24:38 +00:00
Christian Kandeler
058841e8de Locator: Enable to show C++ type aliases
These were not showing up in any global symbol list so far.

Fixes: QTCREATORBUG-5800
Change-Id: I8e5c3b9b26f09d8cbcd31431e28c103da05d9bf8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-09 10:00:56 +00:00
Christian Stenger
ced96a480d CMake: merge binary directories of sub projects
...into top level. Exceptions are applied explicitly.

Change-Id: I59c54967dffc0bef2e8cc05c73763fcf18c12517
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-05 14:09:12 +00:00
Christian Kandeler
59d24fa268 Fix warnings about unused variables
Change-Id: I0bb76529a28c4288967cb79972c1863a0b1c84c6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-05 08:51:44 +00:00
hjk
a5b93b54c8 CPlusPlus: Add missing line and column info for lambda functions
Task-number: QTCREATORBUG-25242
Change-Id: I5032bb04879e30f5516471e2038dc4b6bb3477f8
Reviewed-by: hjk <hjk@qt.io>
2021-02-05 08:51:09 +00:00
Christian Kandeler
bcde1ead55 Fix qbs build
Change-Id: I2e5e385a938343b2dbc487f79e3cf6c7fb2199fa
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-03 16:54:42 +00:00
Fawzi Mohamed
7015ef04b7 qmljs: add check for comparisons not depending on values
currently we mainly try to warn about primitive == null/undefined or
primitive === non primitive.
There are other that we could warn about null==null null==undefined,
but I feel that they might be triggered too much by clean code.

Change-Id: Id43d838d60a4e13f361be34e4bb38211777a081e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-03 14:05:16 +00:00
Fawzi Mohamed
cc00af8334 qmljs: fix qmljscheck
* fix ASTVariableReference::value: correctly get reference value type
by using either initialiser of bindingTarget (broken since a codemodel
update in 2018)
* disable warning for casting in bool to null comparison (it does not
cast, is always false)
* fix property checks (where skipped without default of readonly)
* remove non relevant checks (ErrInvalidPropertyType for lowercase  now that custom
value types are supported, and for properties called data)
* updated import version

Change-Id: I38407acf327d0f773b38dda4c02fb4d95a420851
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-03 14:03:44 +00:00
Fawzi Mohamed
5c1cbf6b3f qmljs: support inline components
* add inline components to bind.
* inserts inline components in the component that contains them (makes
  Context:lookupType simpler)
* unify Context:lookupType overloads without adding extra heap allocations
  using a template (avoid code duplication)
* add tests for inline components
* warn about nested components
* use model manager to load dependencies in tst_check (old test did
  not load dependencies and simply skipped all checks on imports)

Fixes: QTCREATORBUG-24766
Fixes: QTCREATORBUG-24705
Change-Id: Ibcade7752cdaa08e960f66db3a724ab7fb3268cf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-03 09:53:08 +00:00
Fawzi Mohamed
b8d99af6fd qmljs: fix arrow function reformatting
This is mainly just making sure that token that are "empty" are really
empty (to avoid writing them out in the reformatter), but still
contain the correct location (for error messages using for example
firstSourceLocation()).

Introduce a SourceLocation::zeroLength() method to make this change
simpler to do.

QtCreator does not run qlalr automatically, so it is "polluted" by the
updated generated files.

Fixes: QTCREATORBUG-25198
Change-Id: I0ab19fb380ee3d9a7d9e05d104fe313468f52703
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-03 09:52:40 +00:00
Marco Bubke
e34eb170dc QmlDesigner: Add an reason parameter to the image cache abort callback
Sometimes we abort the request, sometimes it failed. In the first case
we maybe want the cancel the imageprovider request, in the second we
return an empty image.

Fixes: QDS-3388
Change-Id: Iaef76aa09ac734795f86447e1a7cf6a5c7b5ae81
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
2021-02-01 16:24:16 +00:00
Marco Bubke
62582877f6 QmlDesigner: Fix flacky test AsynchronousImageCache.WaitForFinished
Change-Id: I94afa8ec2925b85f5dbf44e7b2ad5db484f48148
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-01 16:06:23 +00:00
Marco Bubke
6a0cfc0c6e QmlDesigner: Fix flacky test ImageCacheGenerator.WaitForFinished
Change-Id: I7c08ec68d20a54e125805ad98f87879c99b1aad3
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-01 16:06:19 +00:00
Marco Bubke
1cf09e5979 QmlDesigner: Compress generator tasks
A document change can generate new image request and if the are not in the
database new task for the collector are generated. But if there are already
tasks for an equal id they would generated twice. So the tasks are now
merged. The auxilialry data is not merged because it is expected that
it is not changing.

Task-number: QDS-3388
Change-Id: Id1aceb564dd9dc7c5a1ea5ae4680d7ee36611cda
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-01 16:06:13 +00:00
David Schulz
785932f0f1 Debugger: improve std::unordered_map dumper for cdb
and fix dumper tests

Change-Id: I1debd25a835aba28d77e5605dc49a5ea01221995
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-29 10:59:23 +00:00
Christian Kandeler
11d1b8bb4c Unit test: Add missing switch cases
Amends d8c1e51bfe.

Change-Id: Ida799fdf3ac8da78c892f4f6823009a33b65340b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-26 09:52:53 +00:00
Eike Ziller
aae3bf4ef7 Merge remote-tracking branch 'origin/4.14'
Change-Id: I516e87eed1b716ec085095c9dd4f47f04a99de7c
2021-01-25 09:06:36 +01:00
Christian Kandeler
bfb63acb09 clangbackend: Fix missing completion for private member functions
... when trying to complete the name of a function definition. libclang
tags such completions as "not accessible", even though we are not in a
call context.

Fixes: QTCREATORBUG-25244
Change-Id: I4b03b1a43be7a85c37c7d2b2bfe2d83112075674
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-22 14:49:54 +00:00
Christian Kandeler
d8c1e51bfe ClangCodeModel: Support highlighting angle brackets
... in template declarations and instantiations.

Fixes: QTCREATORBUG-16799
Change-Id: I82bc6411ca980ecbe2a6c70ae37580166a4b89e9
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-22 10:48:33 +00:00
Marco Bubke
7dc72c533e QmlDesigner: Improve imagecache
Instead of coding some arguments to extraId(state) we provide now a
std::variant there extra arguments can be saved. Because it's a
std::variant it can be easlily extended by new structs. There is a new
synchronous interface too. It has an extra method for QIcon which saves
icons in an extra table. It would be even nicer if we would have a
mipmap image too. So we could do it asynchonously too but so far it works
only in the main thread.

Task-number: QDS-3579
Fixes: QDS-3584
Change-Id: If368d84d82308a91a5f4f037021e749c9ef868ed
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-01-21 13:14:28 +00:00
Eike Ziller
f79e4b3677 Merge remote-tracking branch 'origin/4.14'
Change-Id: Ib343adc6b761d15410d357137e4fc38040ce8d48
2021-01-20 11:13:11 +01:00
Fawzi Mohamed
c532076bfd qmljs: fix tst_dependencies
Fixed the dependencies test.

Now it makes sure that all dependencies are loaded before evaluating
the checks, otherwise a race condition in the link process (QTCREATORBUG-25240) might give problems.
This requires running the event loop to ensure that the invokeMethod
in PluginDumper::loadPluginTypes creates the futures in the model
manager.

Change-Id: I4c0dd5cc948917e2a74fd46c3b66ee3bb5370da4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-20 08:12:21 +00:00