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

Method fixBug

src/plugins/chat/copilot.cpp:142–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142void 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
152void Copilot::explain()
153{

Callers

nothing calls this directly

Calls 4

requestAsyncMethod · 0.80
fileTextMethod · 0.45
currentFileMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected