MCPcopy Create free account
hub / github.com/Palm1r/QodeAssist / handleLLMResponse

Method handleLLMResponse

QuickRefactorHandler.cpp:364–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

362}
363
364void QuickRefactorHandler::handleLLMResponse(
365 const QString &response, const QJsonObject &request, bool isComplete)
366{
367 if (request["id"].toString() != m_lastRequestId) {
368 return;
369 }
370
371 if (isComplete) {
372 m_isRefactoringInProgress = false;
373 QString cleanedResponse = PluginLLMCore::ResponseCleaner::clean(response);
374
375 RefactorResult result;
376 result.newText = cleanedResponse;
377 result.insertRange = m_currentRange;
378 result.success = true;
379 result.editor = m_currentEditor;
380
381 LOG_MESSAGE("Refactoring completed successfully. New code to insert: ");
382 LOG_MESSAGE("---------- BEGIN REFACTORED CODE ----------");
383 LOG_MESSAGE(cleanedResponse);
384 LOG_MESSAGE("----------- END REFACTORED CODE -----------");
385
386 emit refactoringCompleted(result);
387 }
388}
389
390void QuickRefactorHandler::cancelRequest()
391{

Callers

nothing calls this directly

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected