| 95 | } |
| 96 | |
| 97 | QVector<RuleFileInfo> RulesLoader::getRuleFiles(const QString &projectPath, RulesContext context) |
| 98 | { |
| 99 | if (projectPath.isEmpty()) { |
| 100 | return QVector<RuleFileInfo>(); |
| 101 | } |
| 102 | |
| 103 | QVector<RuleFileInfo> result; |
| 104 | QString basePath = projectPath + "/.qodeassist/rules"; |
| 105 | |
| 106 | // Always include common rules |
| 107 | result.append(collectMarkdownFiles(basePath + "/common", "common")); |
| 108 | |
| 109 | // Add context-specific rules |
| 110 | switch (context) { |
| 111 | case RulesContext::Completions: |
| 112 | result.append(collectMarkdownFiles(basePath + "/completions", "completions")); |
| 113 | break; |
| 114 | case RulesContext::Chat: |
| 115 | result.append(collectMarkdownFiles(basePath + "/chat", "chat")); |
| 116 | break; |
| 117 | case RulesContext::QuickRefactor: |
| 118 | result.append(collectMarkdownFiles(basePath + "/quickrefactor", "quickrefactor")); |
| 119 | break; |
| 120 | } |
| 121 | |
| 122 | return result; |
| 123 | } |
| 124 | |
| 125 | QVector<RuleFileInfo> RulesLoader::getRuleFilesForProject( |
| 126 | ProjectExplorer::Project *project, RulesContext context) |