mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-02-02 05:10:14 -05:00
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:
@ -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")
|
||||
|
||||
Reference in New Issue
Block a user