Hide public DocumentLocatorFilter::updateCurrentClient()
method and remove
ClangdCurrentDocumentFilter::updateCurrentClient().
Connect DocumentLocatorFilter internally into a new
LanguageClientManager::clientInitialized() signal instead.
Change-Id: Ie74a112bda811525b7d226da1377e5624130e9ed
Reviewed-by: David Schulz <david.schulz@qt.io>
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>
shutdownClient removed the association between the document and the
client, but this is one of the information we would like to keep when
restarting a client. Also we never want to delete the client when
calling restart.
Change-Id: I0558c27ba4b9171c7933edaf2e17847d4e6f62b6
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>
If the language server cannot be started, the client might be already in
an error state before the language server gets initialized.
Change-Id: Ib6c9df13b381e7854806714c07f4830796bb2cd3
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@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>
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>
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>
... to the client interface. JsonRpcMessages are the only messages used
so far and no other types of messages are currently used by any of the
supported Language Servers. If a client is going to need special message
parsing it can still implement a specialized client interface and
overwrite parseCurrentMessage. This is the preparation to move receiving
and parsing data passed to and from the language server out of the GUI
thread.
Change-Id: Ibd4cd95daab7efff947273ca9e7d457de0286f47
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
JsonRpcMessageHandler::toJsonObject can be expensive for huge
json objects like the clangd ast responses for big c++ files. Avoid
calling this function in Request::responseHandler. We already generate a
JsonRpcMessage in JsonRpcMessageHandler::parseContent to get the id of
the response so pass this around.
While at it also pass around references instead of pointers to simplify
the memory handling of generated messages.
Change-Id: I9a3c7e85428fc064d1ea1197d897739725265192
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
LanguageClientManager::deleteClient() may be called directly
from Client::finished() handler, from BaseClientInterface::finished()
handler, from StdIOClientInterface::onProcessFinished() handler
or from QtcProcess::finished() handler. Don't delete
directly any of this objects - delete later instead.
Since now we have delayed the deletion of clients, we can't
send directly the shutdownFinished() signal,
as we have not really finished the shutdown yet.
Since all the calls to clients' deleteLater() were
scheduled before emitting shutdownFinished(),
we send the signal using queued connection, which should
guarantee that all clients' destructor were already executed
before calling asynchronousShutdownFinished().
Task-number: QTCREATORBUG-27316
Change-Id: I4f2c8a756ca86c36cc6324af14b99a9fd4513cd3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
- configure with QTC_USE_NEW_MIMEDATABASE to switch to the new one in
utils/mimetypes2/
- added utils/mimeutils.h header for the Qt Creator specific static
wrappers, that also includes the "public" headers for MimeType et al
from the new or old implementation, depending on configuration
- change all utils/mimetypes/ includes to utils/mimeutils.h
- move the implementation for the wrappers to
utils/mimetypes(2)/mimeutils.cpp
- also move the MimeDatabase declaration in the "old" implementation
back to utils/mimetypes/mimedatabase.h
Change-Id: Ie8de229c035d6cd9a5e4739dc0fa78d9c17228e3
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Otherwise cleanup code connected to QObject::destoyed might not be
executed.
Change-Id: I12bf2b614cf0d216b2f2c0762cc153b4bb845e1f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
If a document is closed between removing a closing client from the
tracked clients in the LanguageClientManager and the actual destruction
of that client we might derefernce an already desctructed document in
resetAssistProvider.
Connect the document closed signal in the client instead of the manager
so Client::closeDocument gets called even if it is not tracked in the
manager anymore.
Fixes: QTCREATORBUG-26534
Change-Id: I7187730600eeb1df54355065eb9cb703a605139e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
The previously connected signals should be safe to stay connected while
the server restarts. This fixes restarting crashed clients more than once.
Change-Id: I161d41418e10b7e3bd3e17141720f4a5f399841c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
So they get an entry in the Window menu, and window related shortcuts
are registered correctly.
Change-Id: Ie7e882a009f928f1268fdd312e7fb5362f6a837f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Iterate on a copy of managerInstance->m_clients
when calling shutdownClient() or deleteClient(),
since both methods may potentially modify m_clients
list and thus invalidate outer iterators.
Surprisingly, this patch also fixes the leak
of RunControl and RunWorker instances on shutdown.
Task-number: QTCREATORBUG-25709
Fixes: QTCREATORBUG-26847
Change-Id: Ib34d913a6ae0b235631d3d619bddaf4e08b4aec2
Reviewed-by: David Schulz <david.schulz@qt.io>
This also prevents assigning a client to a nullptr document.
Change-Id: Iacefe141a08fd47e69faacd4b0cd156c264ac19b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
If a restart for a client has been staged for restart the
shutdown of QC may coincide with the start of the client which
leads to a crash on exit. Correctly track clients that never
successfully started to clean them up on manager destruction.
Change-Id: I639a76318d1665653fbcd37841fcaf407f3d3a83
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
If the server settings specify that a server is to be started "per
project".
This fixes e.g. running the haskell-language-server
Fixes: QTCREATORBUG-26115
Change-Id: If10af71d60786826a9218b4b98818df8d9710adf
Reviewed-by: David Schulz <david.schulz@qt.io>