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();
|
||||
ResultArray result;
|
||||
for (const QJsonValue &val : array) {
|
||||
Command command(val);
|
||||
if (command.isValid())
|
||||
result << command;
|
||||
else
|
||||
result << CodeAction(val);
|
||||
if (val.toObject().value(commandKey).isString()) {
|
||||
const Command command(val);
|
||||
if (command.isValid())
|
||||
result << command;
|
||||
} else {
|
||||
const CodeAction action(val);
|
||||
if (action.isValid())
|
||||
result << action;
|
||||
}
|
||||
}
|
||||
emplace<ResultArray>(result);
|
||||
return;
|
||||
|
Reference in New Issue
Block a user