At least on Apple Clang there is no default constructor
For Text::Position taking two numbers.
Amends 39a448c62e
Change-Id: Ife3630f53d66be38a52ffeb8693bf7574038d083
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
The TextDocumentManipulatorInterface was introduced to decouple
modification operations from QTextDocument. But nowadays all tests and
production code usages are backed by a QTextDocument, so we can remove
this abstraction layer again. The first step is to merge the interface
and all manipulator implementations.
Change-Id: Idd1609df549d3b120dd516d5161af9aa8aa571ca
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
A lot of code had a more suitable place to live in, some was even
unused.
Change-Id: I36478ef473aa14395a182c9ac5e3738fc93134b6
Reviewed-by: David Schulz <david.schulz@qt.io>
... when removing from the list of FollowSymbol operations. The done()
callback of ClangdFollowSymbol messes with the list, so call cancel()
after removing the corresponding iterator.
Change-Id: Ibb72ffa436598692e48119d93d430bb79bcb0f5e
Reviewed-by: hjk <hjk@qt.io>
The original code was written with only the interactive case in mind, but
nowadays we also start "follow symbol" operations internally as part of
e.g. quickfixes.
Change-Id: I95928297fab16f9b0469bfd66ad687447b902fd9
Reviewed-by: David Schulz <david.schulz@qt.io>
Edited the short descriptions to answer the question
"What can I do with this extension" to help users decide
whether they need it.
In long descriptions, tell users what else they need to
be able to use the plugin.
Change-Id: Iefce7505b61fc77cf38cc915f1f7dbd25c9cb570
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Avoid the redirect that is inevitable nowerdays.
Also, change necessitas.kde.org to www.qt.io, since the orgininal page
is offline.
Change-Id: Ib1823f0df97d2df87822fd2bb7552e2f2c7e971e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Replace it with expected_str<FilePath>.
Check periodically for cancel request inside
generateCompilationDB() body.
Cancel the possibly running task on ClangCodeModelPlugin
destruction.
Handle the cancellation.
Change-Id: I8bcb956bc03627b4a17a3510a76810e66c82815d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
... and make use of it.
In most contexts, apply() immediately follows setChangeSet(), so
combining the two can save a lot of code on the call site.
Change-Id: I421001bd47000cb64678a57b19760becf59a4863
Reviewed-by: David Schulz <david.schulz@qt.io>
... and throw away old workarounds.
The current clangd version, to be shipped with Qt Creator 14, is 18.1, so
we can safely bump the minimum version to 17.
Change-Id: I74fd5997196d774b6c47dcb522284953ef82ad9c
Reviewed-by: David Schulz <david.schulz@qt.io>
... and make use of it in ClangdClient.
When a file gets saved, clangd checks all open documents for whether they
are affected by that. While the answer is usually "no", there is still
one thread per document being started to find that out, which triggers
users who keep a close watch on CPU usage. To alleviate this, we now
send the didSave message only for header files.
Fixes: QTCREATORBUG-28580
Change-Id: Id761cec8b04e95a795c8bd8754466bf03b6f2c28
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
Move the global FutureSynchronizer to Utils and use it
by default for AsyncTask (if that is in the main thread).
This way setting a synchronizer is less prone to be forgotten.
Individual uses can still override this.
Change-Id: I1a12bf4d7f4cb5be99668bf0a4797108c2fe6448
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
We'd like to split up the monster files cppquickfixes.cpp and
cppquickfix_test.cpp by moving non-trivial quickfixes into dedicated files.
Since there will be many of them, we want to have them in a separate
directory. This patch prepares that.
Change-Id: I1e78fab5cce25151662297482582c8043618332e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The clang code model already generated issue pane entries for received
diagnostics. Move the tracking of these issue pane entries to the
generic language client support and also generate entries for other
language servers.
Fixes: QTCREATORBUG-30549
Change-Id: I29f2ffbf199c3fdc5ca59a670f5033c833b96a49
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Checking for potential include file completion should only consider
string literals, not number literals.
Fixes: QTCREATORBUG-30607
Change-Id: Ibfb422f1d8be5a5d30489383ecbc359f5ea4a2a9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Not everyone wants to invest the extra computing resources needed for
this feature.
Amends b33b99e2d9.
See 6d805195f6 for the original
motivation.
Task-number: QTCREATORBUG-29943
Change-Id: I4c8cce5bb58b34d930a409ea3e0995377c90d4ab
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
They were originally put alongside the CppCodeModelSettings for
simplicity, but there is no coupling (anymore?) between these two
classes.
Change-Id: Ic24df109b74a5b5c39de073c938c6de12f4aa319
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
This problem has been observed with clangd, but it's probably a good idea to apply the check generally.
Note that in the case of renaming, omitting the filtering can lead to file corruption.
Task-number: QTCREATORBUG-30546
Change-Id: I007edbae2cba5f59e427ab07e183162df9e99367
Reviewed-by: David Schulz <david.schulz@qt.io>
Add a Clangd specific function hint model that alwys highlights the
current parameter based on the number of commas in front of the cursor
position, like the builtin code model. It also correctly closes the
proposal after typing the closing parenthesis.
Fixes: QTCREATORBUG-26346
Fixes: QTCREATORBUG-30489
Change-Id: I09d3ac6856acfe5e0f206d8c3a96dbb561ea2ce7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
The whole point of tracking external changes to files is to use the open
files as a sentinel to indicate that non-open files (on which we don't
have a watch) have likely also been changed.
This reverts commit cff26d813a.
Change-Id: I5a8b3e6709eda881b912916cf0838b45d1ff4fa4
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Previously, the final highlighting results we showed were incomplete and
out of order.
Change-Id: If18062cc5a7f3156d6bb0b282aed33906cdef910
Reviewed-by: David Schulz <david.schulz@qt.io>
This is done by the FutureSynchronizer d'tor, so no need to call
it explicitly. Move the FutureSynchronizer as the last field of
ClangModelManagerSupport so that its d'tor is executed first.
Change-Id: Id38b8ec08579be8e4ade99ecadb511850ff37f8c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
It became the defacto-type for action when ActionBuilder started
creating them as default.
Change-Id: I1008d60b78ea83919ce1c80a7ef828527fe9902c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This deduplicates several mime type strings.
Change-Id: Ib1746387e233ca5b7134e65859b5ec1c7832b8e4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This feels better when stepping through the code but doesn't
really make a difference in the profile.
Change-Id: I2c30578bf1e990b039caadb8b8ce532f009b775d
Reviewed-by: David Schulz <david.schulz@qt.io>
We used to follow a Goto Implementation request with a Goto Definition
request, because the latter gave us the declaration instead of the
definition. This has changed in clangd 17, which means we now called Goto
Definition on a definition, which clangd interprets as switching to the
declaration.
We now do the right thing for all supported clangd versions.
Change-Id: I1c0acd2c8d5c942f7e25dedb1da953bb4f8d8d13
Reviewed-by: Christian Stenger <christian.stenger@qt.io>