| 1340 | } |
| 1341 | |
| 1342 | void 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 | |
| 1371 | void LSPClientPlugin::renameSymbol( UICodeEditor* editor ) { |
| 1372 | UIMessageBox* msgBox = UIMessageBox::New( |
nothing calls this directly
no test coverage detected