Can be used to filter projects get reported to the language client on
server startup and when a project gets opened.
Change-Id: I8cfbc45ecb5251fcaecf2c331a9f1eff966c8db1
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Basically a.onDevice(b) == b.withNewMappedPath(a), matching the order
of b.withNewPath(a).
Whether the (curretly docker-specific) path mapping is useful /there/, and
whether some of the calls are needed at all is dubious. I added some
FIXME and changed a few cases directly.
Change-Id: I7514736ce922f632f1f737bc496f6783389a42b6
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Cloning the document that is needed to track the changes for the
language server is 3 times slower than just getting the whole original
document content and create a new QTextDocument with that content.
Presumably some additional information gets cloned that is not needed
for just the content tracking.
Change-Id: I4a7002b2ac97563f01dc3a67351b9363e9cc7b3f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Add a default close button and connect all language server defined
buttons to accepted, so the message box gets closed when the user
presses a button.
Change-Id: I846eadf5953e75441bdc7910c2587a2fa098a388
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
... out of SessionManager.
The idea is to later move SessionManager into the Core plugin,
which both is sensible conceptually and also prerequisite to
merge the Bookmark plugin into TextEditor plugin.
Currently, only the interface is split, as the load/save
implemetations are non-mechanical to disentangle.
Change-Id: I31631db3094ea192825a2ccaa6add6188662940b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
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>
This change allows the LSP to find a local version of a source
file even if the server is running on a remote device.
Change-Id: I274cb327ad958ac3c4486859da666702758b7d42
Reviewed-by: David Schulz <david.schulz@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>
An error is expected to contain an error message so add one that misses
one. Additionally assert when trying to set an error to a response that
is invalid (does not contain message or code.)
Fixes: QTCREATORBUG-28598
Fixes: QTCREATORBUG-27856
Change-Id: I0631433d847610531758d297a93a5c7cdfdc6c1d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Since we cannot reasonably "cancel" indexing, hide the cancel button
from the progress indicator.
Open the Clangd settings page when clicking on the progress indicator
instead.
Fixes: QTCREATORBUG-27744
Change-Id: I625464e7f7456bcf7f01ce7e52f6bd6b53e3d8b2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.
Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.
Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
Skip the outline update in the initialize callback since no documents
are opened at that point in time and
LanguageClientOutlineWidgetFactory::supportsEditor will always return
false. The update will be triggered in
Client::activateDocument instead.
Change-Id: Ib26115c2344f7a424c31ce09b751a1d711a93aae
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Changed restart timer to 2 minutes and max restarts to 5 for restarting
language client after it exits unexpectedly. This avoids disabling the
language client with clangd 14 in situations where it's likely to crash
during normal editing.
Change-Id: I333bb9d67ed1dbba2b52a1cd916f5d1cf3c0b60b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
Since we are now requiring macOS 10.14 we can remove our local
implementation of optional and use std::optional for macOS too.
Change-Id: I2bd018261b68da64f7f031a812045dd7784697e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Makes sure the highlight is properly updated and prevents assert in
Client::sendMessage.
Change-Id: Ie7ad54c34272867e17f6e20654f27e2fd8711fdc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reverts/comments out parts of 45f93a817a,
which needs to be resolved in a follow-up commit.
Conflicts:
cmake/QtCreatorIDEBranding.cmake
qbs/modules/qtc/qtc.qbs
qtcreator_ide_branding.pri
share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp
src/plugins/clangcodemodel/clangmodelmanagersupport.cpp
src/plugins/cmakeprojectmanager/cmakesettingspage.cpp
src/plugins/python/pythoneditor.cpp
src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp
src/plugins/scxmleditor/common/colorsettings.cpp
Change-Id: I7f0f7b7120e75a9fc3a8886bc57c17345cbb501b
connect calls to a lambda can not be disconnected with the
sender->disconnect(receiver);
syntax, so save the connection in a QMetaObject::Connection and use this
to disconnect the signal.
Fixes: QTCREATORBUG-27596
Change-Id: I69f5d990aab4e85d768e2101f0157a7dee3c1fa1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
While it makes sense to stop trying to restart a continuously crashing
server, the restart counter should be reset regularly, as it's not
critical if the server restarts "once in a while" during a longer
programming session.
Change-Id: Ia2efca28ae4a4dba72da947d9eb776e3909d0cb3
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
This amends 01ceb3a3cb, where we failed to
consider the case of projects with lots of UI headers, which cause
excessive memory use by clangd with our current simplistic approach.
Instead, we now only open ui headers that are used by currently open
documents.
Note that this approach will fail for indirect includes via header files,
but people who do that do not deserve happiness.
Change-Id: I1ef2add701e0f13dc0da79267d3c1367c1b496cc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Remove the closed document from the container that tracks document
modifications to prevent accessing a deleted document.
Change-Id: Iafba8ad3ce054761017a8feca28fdc4c8b379ef6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Generating ui headers in a well-known path and then including that one
in the compilation database does not work in the presence of multiple ui
files with the same name.
As it turns out, we don't have to generate any files at all; instead, we
pass the file contents directly to clangd, which then uses them when
parsing includes of the respective header.
User-visible behavior change apart from the abovementioned bug fix:
Tooltips and "follow symbol" on the include directive now always use the
actual location of the header provided by the build system.
Fixes: QTCREATORBUG-27584
Change-Id: I6b13e12cb3a365199567b0bc824d12b373117697
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>