forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/11.0'
Change-Id: I397dde2f95f62eb4843c39dd861522ae63d7f2c9
This commit is contained in:
@@ -632,13 +632,14 @@ void ClangdClient::handleDiagnostics(const PublishDiagnosticsParams ¶ms)
|
||||
const int docVersion = documentVersion(uri);
|
||||
if (params.version().value_or(docVersion) != docVersion)
|
||||
return;
|
||||
QList<CodeAction> allCodeActions;
|
||||
for (const Diagnostic &diagnostic : params.diagnostics()) {
|
||||
const ClangdDiagnostic clangdDiagnostic(diagnostic);
|
||||
auto codeActions = clangdDiagnostic.codeActions();
|
||||
if (codeActions && !codeActions->isEmpty()) {
|
||||
for (CodeAction &action : *codeActions)
|
||||
action.setDiagnostics({diagnostic});
|
||||
LanguageClient::updateCodeActionRefactoringMarker(this, *codeActions, uri);
|
||||
allCodeActions << *codeActions;
|
||||
} else {
|
||||
// We know that there's only one kind of diagnostic for which clangd has
|
||||
// a quickfix tweak, so let's not be wasteful.
|
||||
@@ -648,6 +649,8 @@ void ClangdClient::handleDiagnostics(const PublishDiagnosticsParams ¶ms)
|
||||
requestCodeActions(uri, diagnostic);
|
||||
}
|
||||
}
|
||||
if (!allCodeActions.isEmpty())
|
||||
LanguageClient::updateCodeActionRefactoringMarker(this, allCodeActions, uri);
|
||||
}
|
||||
|
||||
void ClangdClient::handleDocumentOpened(TextDocument *doc)
|
||||
|
||||
Reference in New Issue
Block a user