forked from qt-creator/qt-creator
LanguageClient: Improve refactoring markers
Clicking the lightbulb should bring up a menu if and only if there is
more than one possible action for this location.
Amends 089e1edcbf.
Change-Id: I45348ed4fbf9b3f32e19bbe17f0c2c030ecd24ed
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -1693,12 +1693,11 @@ void ClangdClient::handleDiagnostics(const PublishDiagnosticsParams ¶ms)
|
||||
return;
|
||||
for (const Diagnostic &diagnostic : params.diagnostics()) {
|
||||
const ClangdDiagnostic clangdDiagnostic(diagnostic);
|
||||
const auto codeActions = clangdDiagnostic.codeActions();
|
||||
auto codeActions = clangdDiagnostic.codeActions();
|
||||
if (codeActions && !codeActions->isEmpty()) {
|
||||
for (CodeAction action : *codeActions) {
|
||||
for (CodeAction &action : *codeActions)
|
||||
action.setDiagnostics({diagnostic});
|
||||
LanguageClient::updateCodeActionRefactoringMarker(this, action, uri);
|
||||
}
|
||||
LanguageClient::updateCodeActionRefactoringMarker(this, *codeActions, uri);
|
||||
} else {
|
||||
// We know that there's only one kind of diagnostic for which clangd has
|
||||
// a quickfix tweak, so let's not be wasteful.
|
||||
|
||||
Reference in New Issue
Block a user