| 221 | } |
| 222 | |
| 223 | QList<CodeAction> parseCodeActions(const QJsonArray &actArray) |
| 224 | { |
| 225 | if (actArray.empty()) |
| 226 | return {}; |
| 227 | |
| 228 | QList<CodeAction> actionList; |
| 229 | static const QStringList badCodeActions { |
| 230 | "remove constant to silence this warning" |
| 231 | }; |
| 232 | |
| 233 | for (auto act : actArray) { |
| 234 | auto actObj = act.toObject(); |
| 235 | CodeAction ca; |
| 236 | ca.title = actObj.value("title").toString(); |
| 237 | ca.kind = actObj.value("kind").toString(); |
| 238 | ca.isPreferred = actObj.value("isPreferred").toBool(); |
| 239 | ca.edit = parseWorkspaceEdit(actObj.value("edit").toObject()); |
| 240 | actionList << ca; |
| 241 | } |
| 242 | |
| 243 | for (auto it = actionList.begin(); it != actionList.end();) { |
| 244 | if (badCodeActions.contains(it->title)) |
| 245 | it = actionList.erase(it); |
| 246 | else |
| 247 | ++it; |
| 248 | } |
| 249 | |
| 250 | return actionList; |
| 251 | } |
| 252 | |
| 253 | Client::Client() |
| 254 | : d(new ClientPrivate(this)) |
no test coverage detected