Feat: Add Claude tools support to plugin (#231)

* feat: Add settings for handle using tools in chat
* feat: Add Claude tools support
* fix: Add ai ignore to read project files list tool
* fix: Add ai ignore to read project file by name tool
* fix: Add ai ignore to read current opened files tool
This commit is contained in:
Petr Mironychev
2025-09-30 23:19:46 +02:00
committed by GitHub
parent 8aa37c5c8c
commit 10b924d78a
23 changed files with 948 additions and 84 deletions

View File

@ -32,6 +32,8 @@ namespace QodeAssist::Tools {
ListProjectFilesTool::ListProjectFilesTool(QObject *parent)
: BaseTool(parent)
, m_ignoreManager(new Context::IgnoreManager(this))
{}
QString ListProjectFilesTool::name() const
@ -92,14 +94,27 @@ QFuture<QString> ListProjectFilesTool::executeAsync(const QJsonObject &input)
}
QStringList fileList;
QString projectPath = project->projectDirectory().toString();
QString projectPath = project->projectDirectory().toUrlishString();
for (const auto &filePath : projectFiles) {
QString absolutePath = filePath.toString();
QString absolutePath = filePath.toUrlishString();
if (m_ignoreManager->shouldIgnore(absolutePath, project)) {
LOG_MESSAGE(
QString("Ignoring file due to .qodeassistignore: %1").arg(absolutePath));
continue;
}
QString relativePath = QDir(projectPath).relativeFilePath(absolutePath);
fileList.append(relativePath);
}
if (fileList.isEmpty()) {
result += QString("Project '%1': No files after applying .qodeassistignore\n\n")
.arg(project->displayName());
continue;
}
fileList.sort();
result += QString("Project '%1' (%2 files):\n")