feat: Popup to show current project rules (#241)

* feat: Popup to show current project rules
* feat: Add icon to show project rules button
* feat: Add counter for active rules
This commit is contained in:
Petr Mironychev
2025-10-23 21:41:59 +02:00
committed by GitHub
parent e1025df21e
commit 608103b92e
9 changed files with 491 additions and 6 deletions

View File

@ -29,15 +29,28 @@ namespace QodeAssist::LLMCore {
enum class RulesContext { Completions, Chat, QuickRefactor };
struct RuleFileInfo
{
QString filePath;
QString fileName;
QString category; // "common", "chat", "completions", "quickrefactor"
};
class RulesLoader
{
public:
static QString loadRules(const QString &projectPath, RulesContext context);
static QString loadRulesForProject(ProjectExplorer::Project *project, RulesContext context);
static ProjectExplorer::Project *getActiveProject();
// New methods for getting rule files info
static QVector<RuleFileInfo> getRuleFiles(const QString &projectPath, RulesContext context);
static QVector<RuleFileInfo> getRuleFilesForProject(ProjectExplorer::Project *project, RulesContext context);
static QString loadRuleFileContent(const QString &filePath);
private:
static QString loadAllMarkdownFiles(const QString &dirPath);
static QVector<RuleFileInfo> collectMarkdownFiles(const QString &dirPath, const QString &category);
static QString getProjectPath(ProjectExplorer::Project *project);
};