MCPcopy Create free account
hub / github.com/SpartanJ/eepp / codeAction

Method codeAction

src/tools/ecode/plugins/lsp/lspclientplugin.cpp:1342–1369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1340}
1341
1342void LSPClientPlugin::codeAction( UICodeEditor* editor ) {
1343 json j;
1344 j["uri"] = editor->getDocument().getURI().toString();
1345 j["pos"] = editor->getDocument().getSelection().start().toString();
1346 mQuickFix = {};
1347 auto req = mManager->sendRequest( PluginMessageType::DiagnosticsCodeAction,
1348 PluginMessageFormat::JSON, &j );
1349
1350 json j2;
1351 j2["uri"] = editor->getDocument().getURI().toString();
1352 j2["line"] = editor->getDocument().getSelection().start().line();
1353 j2["character"] = editor->getDocument().getSelection().start().column();
1354
1355 auto resp =
1356 mManager->sendRequest( PluginMessageType::GetDiagnostics, PluginMessageFormat::JSON, &j2 );
1357 nlohmann::json diagnostics;
1358 if ( resp.isResponse() )
1359 diagnostics = std::move( resp.getResponse().data );
1360
1361 bool sent = mClientManager.codeAction(
1362 editor->getDocumentRef(), diagnostics,
1363 [this, editor]( const LSPClientServer::IdType&, const std::vector<LSPCodeAction>& res ) {
1364 createCodeActionsView( editor, res );
1365 } );
1366
1367 if ( !sent )
1368 editor->getDocument().execute( "spellchecker-fix-typo", editor );
1369}
1370
1371void LSPClientPlugin::renameSymbol( UICodeEditor* editor ) {
1372 UIMessageBox* msgBox = UIMessageBox::New(

Callers

nothing calls this directly

Calls 11

getURIMethod · 0.80
getDocumentMethod · 0.80
columnMethod · 0.80
getResponseMethod · 0.80
getDocumentRefMethod · 0.80
toStringMethod · 0.45
startMethod · 0.45
getSelectionMethod · 0.45
sendRequestMethod · 0.45
isResponseMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected