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

Method executeAsync

tools/GetIssuesListTool.cpp:144–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144QFuture<LLMQore::ToolResult> GetIssuesListTool::executeAsync(const QJsonObject &input)
145{
146 return QtConcurrent::run([input]() -> LLMQore::ToolResult {
147
148 QString severityFilter = input.value("severity").toString("all");
149
150 const auto tasks = IssuesTracker::instance().getTasks();
151
152 if (tasks.isEmpty()) {
153 return LLMQore::ToolResult::text("No issues found in Qt Creator Issues panel.");
154 }
155
156 QStringList results;
157 results.append(QString("Total issues in panel: %1\n").arg(tasks.size()));
158
159 int errorCount = 0;
160 int warningCount = 0;
161 int processedCount = 0;
162
163 for (const ProjectExplorer::Task &task : tasks) {
164
165#if QODEASSIST_QT_CREATOR_VERSION >= QT_VERSION_CHECK(18, 0, 0)
166 auto taskType = task.type();
167 auto taskFile = task.file();
168 auto taskLine = task.line();
169 auto taskColumn = task.column();
170 auto taskCategory = task.category();
171#else
172 auto taskType = task.type;
173 auto taskFile = task.file;
174 auto taskLine = task.line;
175 auto taskColumn = task.column;
176 auto taskCategory = task.category;
177#endif
178 if (severityFilter == "error" && taskType != ProjectExplorer::Task::Error)
179 continue;
180 if (severityFilter == "warning" && taskType != ProjectExplorer::Task::Warning)
181 continue;
182
183 QString typeStr;
184 switch (taskType) {
185 case ProjectExplorer::Task::Error:
186 typeStr = "ERROR";
187 errorCount++;
188 break;
189 case ProjectExplorer::Task::Warning:
190 typeStr = "WARNING";
191 warningCount++;
192 break;
193 default:
194 typeStr = "INFO";
195 break;
196 }
197
198 QString issueText = QString("[%1] %2").arg(typeStr, task.description());
199
200 if (!taskFile.isEmpty()) {
201 issueText += QString("\n File: %1").arg(taskFile.toUrlishString());

Callers

nothing calls this directly

Calls 8

valueMethod · 0.80
getTasksMethod · 0.80
appendMethod · 0.80
sizeMethod · 0.80
toStringMethod · 0.45
isEmptyMethod · 0.45
typeMethod · 0.45
descriptionMethod · 0.45

Tested by

no test coverage detected