Using std::lower_bound is more generic and we have less code which
could lead to less bugs.
Change-Id: Iacf6ea550182b51a8d5dd6b18a92de68914f4df1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Using an explicit class for the storage not even makes the code easier
to understand but enables the possibility of code optimizations too.
Change-Id: I9239919d3385ba1bf141c23bdc3013b6c1e624ed
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Sometimes it is handy to return a range so you can break in a for range
loop. So you can now write:
for (auto [key, value] :
statement.range<std::tuple<long long, std::string>>()) {
values.push_back(value);
if (value == Tuple{"foo", 23.3, 2})
break;
}
for (auto [key, value] :
statement.rangeWithTransaction<std::tuple<long long, std::string>>()) {
values.push_back(value);
if (value == Tuple{"foo", 23.3, 2})
break;
}
It will only step over the statement to the break. So you don't fetch
not used values anymore. The second version will add a transaction
around the range.
But be careful. The range is view to the statement. Holding it longer or
reusing it can lead to strange behavior because the state of the
statement is changing.
Change-Id: I90191f7da5a015c7d8077d5bc428655a2b53246c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Missed to remove the not anymore used ResultTypeCount.
Change-Id: Ia150e945bd650cc1e3d19fcb9426621d93fa16c3
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Now there is iter_swap, rotate and reverse in the node list property. With
that methods we can implement slide too.
Task-number: QDS-4159
Change-Id: Ie7f80f64fd26e517ca696158a878262928dc82c4
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
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>
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>
ImageCacheGenerator.CleanIsCallingAbortCallback was not waiting for the
expected call.
Task-number: QTCREATORBUG-25580
Change-Id: I43265389a36e568dea7c7ece5524ef597232d049
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Apparently, we can prevent clang-format from removing line breaks by
adding an empty comment at the end of the line.
Change-Id: Ia78ecb9e7351d059c544cbda11d33af5734e2218
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
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>
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>
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>
... 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>
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>
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>
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>
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>
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>
... 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>
... in template declarations and instantiations.
Fixes: QTCREATORBUG-16799
Change-Id: I82bc6411ca980ecbe2a6c70ae37580166a4b89e9
Reviewed-by: David Schulz <david.schulz@qt.io>
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>
You can now pass everything you can convert to a span directly and bind it
with a carray instead of using the pointer interface. This is working for
int, long long, double and null terminated C strings.
Change-Id: I274c218e2dec0f11e68576545bb78601f85462bd
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Those warnings should be printed via the clang code model, which can be
fine tuned to (de-)activate warnings. The clang-diagnostic-* warnings
from clang-tidy are not shown in the dialog an thus can not be
selectivly activated by the user.
Change-Id: I80b2cad227a9fd8fa0de253c73c40abfa8076be6
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
For the CPlusPlus target the target sources contain
"$<TARGET_OBJECTS:3rd_cplusplus>" with older CMake versions.
Looks like that was fixed in CMake 3.14.
Work around it by removing TARGET_OBJECT entries, which we definitely
don't want.
Change-Id: I036720f122aa2d0727e85b611f1e32c65fae57ae
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Parts of QC cannot be linked against a release build of clangTooling
libs and vice versa when building on Windows.
Check whether the provided libs match the current build mode and
disable respective parts if necessary.
Re-use this information to decide whether unittest should be build
or not.
Change-Id: Ibc2aab0d7886e78ebbf8f15a43152efad49f1eff
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
... in cases where it appears that clang_annotateTokens() did not do
what we wanted.
Fixes: QTCREATORBUG-21522
Change-Id: I272061cb6c4b51a5d779ace5b4e06912c0a386e5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>