LanguageClient: disable diagnostics after document changes

Calculating new diagnostics after a document change can take a while.
The old ClangCodeModel disabled diagnostics (changed the color to gray)
that were reported before the last document change after some time.
Adapt this behavior to Clangd and other LSP based codemodels.

Change-Id: I0589ba0d0c023f6e7ea3e97fc5b45eb156ddcd37
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
David Schulz
2022-05-23 12:33:01 +02:00
parent 16aaf8c59c
commit 4ab935349f
3 changed files with 31 additions and 10 deletions

View File

@@ -918,6 +918,7 @@ void Client::documentContentsChanged(TextEditor::TextDocument *document,
{
if (!d->m_openedDocument.contains(document) || !reachable())
return;
d->m_diagnosticManager->disableDiagnostics(document);
const QString method(DidChangeTextDocumentNotification::methodName);
TextDocumentSyncKind syncKind = d->m_serverCapabilities.textDocumentSyncKindHelper();
if (Utils::optional<bool> registered = d->m_dynamicCapabilities.isRegistered(method)) {