Restarts the client with temporarily disabled indexing. The block is
reset after starting clangd, so any subsequent changes to the
configuration or the project will start the client again with indexing
enabled.
Change-Id: I16c975b6ef0b56f27ce5b2ced01f534f8ae0b4d3
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This is needed to keep annotations hidden after the restart of clangd if
the user disabled them in the text mark tooltip.
Change-Id: I69a668f2ba71f1dda83eca74a064af7ec1f92e77
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
The hiding is not persistent, so on the next Qt Creator start all
annotations are visible again. This is meant to quickly get rid of
annotations if there are to many irrelevant of a specific kind.
Change-Id: I4862e56e0f5624f30aadda26efc9dea672ab1f57
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...
While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only
Change was done by running
find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;
Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
We now get a semantic token "operator" from clangd;
see https://reviews.llvm.org/D136594.
As a side effect, this results in the following subtle changes in what
exactly gets highlighted, both of which make sense:
- The type part of a conversion operator is now highlighted as
a type, not an operator.
- We no longer add special highlighting for the brackets in
operator new[] and operator delete[].
Change-Id: Ic149487496768762728a712c9fbcde5c9516529c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
Preparation for adding more generators.
Task-number: QTCREATORBUG-28149
Change-Id: I4afa183a6fbd8ee88fc978b382f28cf9e52f09e9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The preferences dialog is modal and creates an event loop that would be
running within the mouse event handler of the widget. When the dialog is
closed after the widget is destroyed (i.e. after indexing finished),
control would be passed back to the destroyed widget, and crash.
Fixes: QTCREATORBUG-28566
Change-Id: I71efa683822b5682ad1b38c39ce8f73c89bdd610
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
If the error messages of clangd are not shown in the Ui, it is very
difficult / impossible for the user to analyze problems when they
occur.
Change-Id: I81e2fc9aa999332147837adf54dfac49233e6f99
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
...from the code assistant to the language client specific assist
implementation. This further reduces the complexity of the code
assistant.
Change-Id: I08ba5eecea826d3ccfe7f1f5a8791a085299d6ef
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
This is relevant when clang-cl is used to compile Objective-C projects.
Task-number: QTCREATORBUG-28369
Change-Id: If8ae4dfaa07bf2ec81fbbec358663617c430b9e2
Reviewed-by: Frederik Seiffert <frederik@algoriddim.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
We cannot tell clangd to opt out of indexing for certain files, so we
must prevent "foreign" sources from ever getting opened, or we will have
strange effects in the case of non-unique symbols.
Note that there are more (upstream) problems in this area, but this
patch limits the damage at least.
Amends 8ad7ab2d2a.
Fixes: QTCREATORBUG-28452
Change-Id: I131be699a35da8eacea6415c630e9012cc905a47
Reviewed-by: David Schulz <david.schulz@qt.io>
Note that especially in C++, there can be a lot of false positives,
especially in template-heavy code bases. We filter out the most notorious
offenders, namely:
- templates themselves
- constructors and destructors
- *begin() and *end()
- qHash()
- main()
Since the code model does not know about symbol visibility, the
functionality is quite useless for libraries, unless you want to check
your test coverage.
The procedure is rather slow, but that shouldn't matter so much, as it's
something you'll only run "once in a while".
Fixes: QTCREATORBUG-6772
Change-Id: If00a537b760a9b0babdda6c848133715c3240155
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The starts with CppDocument::filePath(), plus a bit of the fallout
This is one patch of potentially many. It is hard to draw the
line where to stop this kind of chunk, this here converts a few
additional functions for which including it in the patch looked
like less churn than without.
Converting is mostly fromString/toString, with a few exceptions
for "already seem" like caches, that use cheaper "path()" to
avoid likely performance regressions (on Windows FilePath
comparison is currently case-insenstive, and more expensive).
There should be no difference for local operation with this patch.
Change-Id: I7b35f98a0a6f0bfed4ea0f8f987faf586f7a8f2b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This way the base class can manage the lifetime of the interface object
and it doesn't need to be done in each implementation of perform.
Change-Id: Ie1ce742e31b688a337533ee6c57d376146e25ace
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
These are files that we temporarily report to the server as "open"
without actually having a document for them. Since this mechanism is
used in several places, we'd like to keep a consistent state even when
such actions overlap.
Change-Id: I0cfe3427740ec479926bc114848ad08f8866bdbb
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
Define the run type of the processor by its implementation instead of a
enum value of the provider. The execution of a processor inside the
assist now follows a unified procedure.
Change-Id: Ibe9fab324c6072e77702c2663946d7a9f562a085
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
That is, recognize '"', '<' and '/' as activation characters, like the
built-in code model.
Note that we do not actually start the LSP completion procedure for
these unless we really are in an #include directive.
Fixes: QTCREATORBUG-28203
Change-Id: I85727d0e392a27efa8549e7d6fa5f18f953774b4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
The complete memory management in the code assistant needs an overhaul.
For now just delete or at least track the assist interface with scoped
pointers.
Fixes: QTCREATORBUG-28408
Change-Id: I0bd4cfaa36a660b6fd5bb467af3b13414ed76e63
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
In particular, in a variable definition, the (invisible) reference to the
constructor is *not* a declaration (but an implicit call).
Change-Id: Ic1f29a4da360959e81ec536efbf1175924ea34d7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
If both AST and document symbols are available right away, the
ClangdSwitchDeclDef object emits its done() signal before it is
connected and stays around, potentially firing off new "follow symbol"
requests to the bewilderment of innocent users.
Fixes: QTCREATORBUG-28183
Change-Id: I972c8d4d9d7b7435e293d76fe710b19c9c4fb287
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>