MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / parseCodeActions

Function parseCodeActions

src/common/lsp/client/client.cpp:223–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221}
222
223QList<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
253Client::Client()
254 : d(new ClientPrivate(this))

Callers 1

diagnosticsCalledMethod · 0.85

Calls 8

parseWorkspaceEditFunction · 0.85
eraseMethod · 0.80
emptyMethod · 0.45
toStringMethod · 0.45
valueMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected