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:
@@ -955,13 +955,14 @@ void Client::handleCodeActionResponse(const CodeActionRequest::Response &respons
|
||||
log(*error);
|
||||
if (const Utils::optional<CodeActionResult> &result = response.result()) {
|
||||
if (auto list = Utils::get_if<QList<Utils::variant<Command, CodeAction>>>(&*result)) {
|
||||
QList<CodeAction> codeActions;
|
||||
for (const Utils::variant<Command, CodeAction> &item : *list) {
|
||||
if (auto action = Utils::get_if<CodeAction>(&item))
|
||||
updateCodeActionRefactoringMarker(this, *action, uri);
|
||||
else if (auto command = Utils::get_if<Command>(&item)) {
|
||||
codeActions << *action;
|
||||
else if (auto command = Utils::get_if<Command>(&item))
|
||||
Q_UNUSED(command) // todo
|
||||
}
|
||||
}
|
||||
updateCodeActionRefactoringMarker(this, codeActions, uri);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user