Add a private function that logs and sends a basemessage without
checking the current server state and use it for server init,
sendContent and exit.
Change-Id: I6532dfb36ef5bf4d036bb71dbfab4ab29497fc9a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@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>
instead of spreading them over the place.
- rename "Logger..." to "Show Logs..."
- create "Tools > Debug Qt Creator" menu and put "Show Logs", "Inspect
Language Clients" and "Inspect C++ Code Model" there
- add missing ellipsis
That gets rid of the otherwise not useful "Language Client" submenu, and
creates a nicer place for the "Show Logs" item.
Change-Id: I2588b4c93327669579979dfbfce37005ada29dab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
When setting an external editor as the default editor in the MIME type
settings.
Other operations like File > Open, or when using navigation shortcuts
like Follow Symbol, and stepping with the debugger will still always
open the file within Qt Creator. The Open with... menu can still be used
to explicitly open a file in an external editor afterwards.
One of the use cases is to be able to open some files that would
otherwise unhelpfully be opened in Qt Creator's binary editor in the
systems default editor.
Fixes: QTCREATORBUG-13880
Change-Id: I852f097da8badd10de78b74e7078987447eebe98
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Removes qmake as a build system for building Qt Creator itself.
Keep them for some tests that are not completely moved to CMake yet.
Change-Id: I846c6ef65626b6dfae6375fdc85d00677aa8c2fb
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Adapt all callers' code so that it passes the FilePath
instead of QString. As a consequence introduce
TemporaryDirectory::masterDirectoryFilePath() and use
it where easily possible.
Change-Id: I14564949b3b916921e32a2957c84c03d1da43af2
Reviewed-by: hjk <hjk@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>
The request for highlights of the symbol under the cursor takes a
considerable amount of time on some servers (at least python). Postpone
those requests a bit so that more important requests can be handled
before.
Change-Id: I35776076a4ee9c0c9b7646e960d3d965506154d3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
A usual error we receive for semantic request is that the request got
canceled. This can be due to external changes. But a server might still
be able to calculate a diff against a previous token set. So just keep
the previously reported tokens and rerequest a new highlight. If the
server is not able to calculate a diff it also might send a full
token set as a result for the delta request according to the protocol.
Fixes: QTCREATORBUG-26624
Change-Id: Ia91e599706519dbbf4cd22050484e4f36cecdab8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
In order to correctly start a language server after it was added
programmatically it needs to be marked as changed.
Fixes the issue that the python language server did not get started
right after setting it up from the editor info bar.
Change-Id: I9caec91c9d5973912b7379478ab079c87a5231ce
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The Client might be already deleted when the text editor codeassist
calls cancel on the processor.
Change-Id: I6b0b484a086456ed9d0543f530aea0fae32c523a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
If the cursor is right before the "." in a member access expression,
clangd interprets it as belonging to the member instead of the base
expression, which leads to unexpected behavior.
Work around this by sending a cursor position one to the left of the
real one to clangd in such cases.
Change-Id: I429ee9189760ccb02d231acfcb94ab6cfde3cd8d
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>
When multiple items in the editor outline match the current cursor
select the inner most item.
Fixes: QTCREATORBUG-26509
Change-Id: Ib4ced177059e3a9914ace35e4cdc34959719091a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
LanguageClient::updateEditorToolBar() contained the static
hashes that were keeping raw pointers to different
objects. However, the lifetime of these objects wasn't
controlled, so it could happen that we were operating
on dangling pointers.
In fact, like in the bugreport, some text editor widget could have
been deleted (together with his outline action), while later another
one (coincidently with the same address) could have appeared.
The old mapped widget still pointed to the removed action
so we crash.
Instead of keeping a static hashes we attach the custom
child object to the widget and keep there QPointers to all objects
we are interested in.
Fixes: QTCREATORBUG-26588
Change-Id: I335d9848ea85372baf3328772f0a249cee242dcd
Reviewed-by: David Schulz <david.schulz@qt.io>
Restructure the message handling in the client, so if we get a message
with an id always send a response to the server either with the result
or with an error. Also make sure to not send responses to unreachable
server.
Change-Id: Ie74128069c1678af60871896d5dce45c08e71b05
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This also prevents assigning a client to a nullptr document.
Change-Id: Iacefe141a08fd47e69faacd4b0cd156c264ac19b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This can now happen due to the newly implemented refresh support.
Change-Id: If64feede84b044140f7ec04e317289d3f493aa53
Reviewed-by: David Schulz <david.schulz@qt.io>