| 14 | namespace QodeAssist::PluginLLMCore { |
| 15 | |
| 16 | QString RulesLoader::loadRules(const QString &projectPath, RulesContext context) |
| 17 | { |
| 18 | if (projectPath.isEmpty()) { |
| 19 | return QString(); |
| 20 | } |
| 21 | |
| 22 | QString combined; |
| 23 | QString basePath = projectPath + "/.qodeassist/rules"; |
| 24 | |
| 25 | switch (context) { |
| 26 | case RulesContext::Completions: |
| 27 | combined += loadAllMarkdownFiles(basePath + "/completions"); |
| 28 | break; |
| 29 | case RulesContext::Chat: |
| 30 | combined += loadAllMarkdownFiles(basePath + "/common"); |
| 31 | combined += loadAllMarkdownFiles(basePath + "/chat"); |
| 32 | break; |
| 33 | case RulesContext::QuickRefactor: |
| 34 | combined += loadAllMarkdownFiles(basePath + "/common"); |
| 35 | combined += loadAllMarkdownFiles(basePath + "/quickrefactor"); |
| 36 | break; |
| 37 | } |
| 38 | |
| 39 | return combined; |
| 40 | } |
| 41 | |
| 42 | QString RulesLoader::loadRulesForProject(ProjectExplorer::Project *project, RulesContext context) |
| 43 | { |