forked from qt-creator/qt-creator
LSP: Fix CodeActionResult
The isValid check now works on both objects since the error message simplification. So check the command property and see whether it is a string to identify the object. Change-Id: Iaafe2d868267ebb83440d72703ee3edc517385d8 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -353,11 +353,15 @@ CodeActionResult::CodeActionResult(const QJsonValue &val)
|
|||||||
const QJsonArray array = val.toArray();
|
const QJsonArray array = val.toArray();
|
||||||
ResultArray result;
|
ResultArray result;
|
||||||
for (const QJsonValue &val : array) {
|
for (const QJsonValue &val : array) {
|
||||||
Command command(val);
|
if (val.toObject().value(commandKey).isString()) {
|
||||||
|
const Command command(val);
|
||||||
if (command.isValid())
|
if (command.isValid())
|
||||||
result << command;
|
result << command;
|
||||||
else
|
} else {
|
||||||
result << CodeAction(val);
|
const CodeAction action(val);
|
||||||
|
if (action.isValid())
|
||||||
|
result << action;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
emplace<ResultArray>(result);
|
emplace<ResultArray>(result);
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user