| 140 | } |
| 141 | |
| 142 | void Copilot::fixBug() |
| 143 | { |
| 144 | auto currentFileText = editorService->fileText(editorService->currentFile()); |
| 145 | currentFileText.replace(selectedText(), "<START EDITING HERE>" + selectedText() + "<STOP EDITING HERE>"); |
| 146 | QString prompt = "code: ```%1```\n\n" |
| 147 | "Rewrite the code between <START EDITING HERE> and <STOP EDITING HERE> in this entire code block. The rewrite requirements are: fix any bugs in this code, or do a simple rewrite if there are no errors, without leaving placeholders. Answer only the code between these markers."; |
| 148 | ChatManager::instance()->requestAsync(prompt.arg(currentFileText)); |
| 149 | switchToChatPage(); |
| 150 | } |
| 151 | |
| 152 | void Copilot::explain() |
| 153 | { |
nothing calls this directly
no test coverage detected