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

Method fixIssueWithAi

src/plugins/builder/tasks/taskmanager.cpp:118–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118void TaskManager::fixIssueWithAi(const QModelIndex &index)
119{
120 auto realIndex = filterModel->mapToSource(index);
121 const auto &task = model->task(realIndex);
122 if (task.isNull())
123 return;
124
125 QString context;
126 if (!task.file.toString().isEmpty() && task.line > 0)
127 context = readContext(task.file.toString(), task.line - 1);
128
129 QString prompt = context + "\n\n";
130 const auto title = OptionManager::getInstance()->getValue("Builder", "CurrentPrompt").toString();
131 if (title.isEmpty()) {
132 prompt += SettingDialog::defaultIssueFixPrompt() + '\n';
133 } else {
134 const auto prompts = OptionManager::getInstance()->getValue("Builder", "Prompts").toMap();
135 prompt += prompts.value(title).toString() + '\n';
136 }
137
138 prompt += task.description;
139 aiSrv->chatWithAi(prompt);
140 winSrv->showWidgetAtRightspace(MWNA_CHAT);
141}
142
143void TaskManager::currentChanged(const QModelIndex &index)
144{

Callers

nothing calls this directly

Calls 7

mapToSourceMethod · 0.80
taskMethod · 0.45
isNullMethod · 0.45
isEmptyMethod · 0.45
toStringMethod · 0.45
getValueMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected