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

Method addComment

src/plugins/chat/copilot.cpp:126–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126void Copilot::addComment()
127{
128 QString prompt = "You're an intelligent programming assistant."
129 " You'll answer any questions you may have about programming, code, or computers, and provide formatted, executable, accurate, and secure code."
130 " Task: Please provide a comment for the input code, including multi-line comments and single-line comments, please be careful not to change the original code, only add comments."
131 " Directly return the code without any Markdown formatting, such as ```, ```cpp, etc. "
132 "\n\ncode: ```%1```";
133 copilotLLM->setStream(false);
134 copilotLLM->request(prompt.arg(selectedText()), [=](const QString &data, AbstractLLM::ResponseState state){
135 if (state == AbstractLLM::ResponseState::Success) {
136 if (!data.isEmpty())
137 replaceSelectedText(data);
138 }
139 });
140}
141
142void Copilot::fixBug()
143{

Callers

nothing calls this directly

Calls 3

setStreamMethod · 0.45
requestMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected