This is needed for e.g. ClangdClient, which may need to update even if
the highlighting delta from the server is empty.
Task-number: QTCREATORBUG-26183
Change-Id: I38398c9563fa7a6a1906c5cb57fd1cbcd444cbd9
Reviewed-by: David Schulz <david.schulz@qt.io>
If the position was changed right before the document was edited the
timer might still be running.
Change-Id: Ieaa4de5cc10f25e6d58afaf9525417e11a34d1db
Reviewed-by: Christian Kandeler <christian.kandeler@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>
Even if we do not have to provide any data just send a null as the
result so the server nows that the request did not fail.
Fixes: QTCREATORBUG-26116
Change-Id: I9b965389bb197cdd81d0d3ffbac05f289cabda40
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Opening a document in the language client while the server is still
initializing will postpone the opening after the server is fully
initialized. So if a document was scheduled for opening by
ClangModelManagerSupport::onEditorOpened while clangd is still
initializing, skip the superfluous opening in the ClangdClient
initialize callback. Clangd seems to have issues if files are opened
twice, resulting in strange diagnostics after editing the file. This is
reproducible for me when starting Qt Creator with a session that
contains open files.
Change-Id: I200d5c8afb685403f0435e0553f5a475f75e8ea2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
.. after receiving diagnostics since the code actions are already
inlined into the diagnostics.
Change-Id: I11ed1270344ff5119dd111503d173eef2f340c1d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
If the document highlights are requested after a timeout the document
might have changed again inbetween leading to another document change
notification that gets send to the server.
Change-Id: I476e833c55e1bed96c9bd49ee2f17915ee3536a2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Note that we lose the highlighting for virtual function calls. We need
to amend clangd to add the respective information to its semantic tokens
message.
Also, Qt properties are no longer highlighted as class members. We'll
investigate how to best restore this feature.
Change-Id: I403712aada3d7a8e1c7b7c1277f43f7f64f8450b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
Note that we used to encode the information about symbol visibility and
static-ness in the icons, which we can't do anymore, because clangd does
not provide this information.
On the upside, this change likely fixes a ton of bugs, as our own outline
was rather "quirky".
Change-Id: I099f11ec4e3c6f52cd461fb43080bbdde3bed5e5
Reviewed-by: David Schulz <david.schulz@qt.io>
We track the document revision in the client nowadays.
Change-Id: Ia55bc7cd5eaf100fb19953ca71e8de8f43ae3266
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Using the document revision causes issues for some servers.
Task-number: QTCREATORBUG-25766
Change-Id: Ic858e19c6fe39e57c9d3124913887aafee0a3cd0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Otherwise we will have dangling progress bars after a crashed server was
restarted.
Change-Id: I889d201d7cf196623978638db67397203a8f4564
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Mechanical to prepare merging the actual classes.
Adapting #includes.
Change-Id: I77a2c28129287778bc870c30cb890cd26bc2e62b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Server name and version are potentially interesting information.
Change-Id: I4fc9a2556d7fd8285fe0024cf0f83baf95112e65
Reviewed-by: David Schulz <david.schulz@qt.io>
... and make use of it in the clangd client to be able tell when
background indexing has finished.
Change-Id: I0f3c6f9646fd66ababd08c12b2f347da5f1a3729
Reviewed-by: David Schulz <david.schulz@qt.io>
... and make use of it in the clangd client.
We want the progress bar for background indexing to have a better title
than the plain (and non-translated) "indexing" that the clangd server
sends.
Change-Id: Ib75eac370e7c22f0c5bd477f4a4c423283b27e1f
Reviewed-by: David Schulz <david.schulz@qt.io>
If the user has enabled clangd (default is off), we start up one instance
per project when it is opened/changed (including build config switches),
and trigger background indexing.
So far, the index is used to provide results for locators and "Find
Usages".
Per-document functionality such as semantic highlighting and completion
is still provided by libclang.
Change-Id: I12532fca1b9c6278baab560e7238cba6189cde9f
Reviewed-by: David Schulz <david.schulz@qt.io>
Only assign documents to a client if the client was started by a
setting. Programatically started clients should handle assigned
documents manually.
Change-Id: I192c4c011a48e0406f267d3cab3c860f740ddad7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Now we search for the key twice in the hash, but the hash shouldn't get
to big and the lookup doesn't happen very often.
Change-Id: I4751a8203321bb4c1ea5092b89593971d736e034
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
We can have multiple widgets per document, so we can have multiple
different cursors for the same document. Tracking document highlights
per widget prevents cancelling a potentially valid request for another
text cursor of another widget.
Change-Id: I800d9be5b44b327351252ab90305b8882efa87bb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Instead of checking recursively every possible object just check the
required keys for an object and validate it on construction or
assignment from json.
This will reduce the implementation effort for protocol extensions and
also reduce the false positives we might get if the protocol gets
updated.
Change-Id: I3df24e62430d2c7575d26c1581e6a9606e7da4c1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
If the client was opened for a specific project.
Change-Id: Iafc9f5d46d06e2e656702260f297d6b2b998a431
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Send the workspace change method before the server gets shut down.
Prevents an assert in Client::sendContent.
Change-Id: Iaedc9829379d987aa6f91a87e26d35b64a9f0f55
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The capabilities are not changeable for the user, but only there to
check whether a server is capable of a specific task. This will also
allow us to have more specialized settings widgets for specific servers
like for the java language server without the need to add the
capabilities to each of those special widgets.
Also add the dynamic capabilities to the widget so users have a complete
overview of the capabilities.
Change-Id: I9f2ed6ed11b458f0d4c67be3df632fd810023286
Reviewed-by: Christian Stenger <christian.stenger@qt.io>