Skip to content

Commit

Permalink
docs: optimize doc
Browse files Browse the repository at this point in the history
  • Loading branch information
2214962083 committed Aug 14, 2024
1 parent 9e88d6c commit 0b24783
Show file tree
Hide file tree
Showing 35 changed files with 504 additions and 284 deletions.
86 changes: 1 addition & 85 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -233,91 +233,7 @@
},
"aide.expertCodeEnhancerPromptList": {
"type": "array",
"default": [
{
"match": "**/*",
"title": "%config.expertCodeEnhancerPromptList.solid%",
"prompt": "Please refactor the following code to better adhere to SOLID principles. Focus on Single Responsibility, Open-Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion where applicable. Explain your changes briefly in comments.",
"sort": 150,
"autoContext": false
},
{
"match": "**/*",
"title": "%config.expertCodeEnhancerPromptList.dry%",
"prompt": "Refactor the following code to eliminate redundancy and improve maintainability by applying the DRY (Don't Repeat Yourself) principle. Identify repeated code patterns and abstract them into reusable functions or classes as appropriate.",
"sort": 160,
"autoContext": false
},
{
"match": "**/*",
"title": "%config.expertCodeEnhancerPromptList.designPatterns%",
"prompt": "Analyze the following code and suggest refactoring using appropriate design patterns. Consider creational, structural, and behavioral patterns that could improve the code's flexibility, maintainability, and scalability.",
"sort": 170,
"autoContext": false
},
{
"match": [
"**/*.vue",
"**/*.tsx",
"**/*.jsx"
],
"title": "%config.expertCodeEnhancerPromptList.splitComponents%",
"prompt": "Analyze the following code and split it into smaller, more manageable components. Focus on identifying reusable parts, separating concerns, and improving overall component structure. Provide the refactored code with new component files clearly separated.",
"sort": 140,
"autoContext": true
},
{
"match": "**/*",
"title": "%config.expertCodeEnhancerPromptList.cleanliness%",
"prompt": "Refactor the following code to improve its cleanliness and readability. Focus on consistent naming conventions, appropriate comments, logical code organization, and reducing complexity. Ensure the code follows best practices for the given language.",
"sort": 180,
"autoContext": false
},
{
"match": "**/*",
"title": "%config.expertCodeEnhancerPromptList.performance%",
"prompt": "Review the following code and optimize it for better performance. Focus on algorithmic efficiency, reducing unnecessary computations, and improving data structure usage. If applicable, consider asynchronous operations and memory management.",
"sort": 190,
"autoContext": true
},
{
"match": [
"**/*.sql",
"**/*Repository.{java,kt,scala,cs,py,js,ts}",
"**/*Dao.{java,kt,scala,cs,py,js,ts}",
"**/*Mapper.{java,kt,scala,cs,py,js,ts}",
"**/*Query.{java,kt,scala,cs,py,js,ts}",
"**/*.orm.{py,rb}",
"**/*.entity.{ts,js}",
"**/*Service.{java,kt,scala,cs,py,js,ts}"
],
"title": "%config.expertCodeEnhancerPromptList.databaseQueries%",
"prompt": "Analyze and optimize the database queries in the following code. Focus on improving query performance, reducing unnecessary joins, optimizing indexing suggestions, and ensuring efficient data retrieval patterns.",
"sort": 130,
"autoContext": true
},
{
"match": "**/*",
"title": "%config.expertCodeEnhancerPromptList.security%",
"prompt": "Review the following code and enhance its security measures. Focus on identifying and mitigating common vulnerabilities such as SQL injection, XSS, CSRF, and insecure data handling. Provide safer alternatives and explain the security improvements.",
"sort": 200,
"autoContext": true
},
{
"match": [
"**/*.{java,kt,scala,cs,go,cpp,c,rs,py}",
"**/*Async*.{java,kt,scala,cs,go,cpp,c,rs,py}",
"**/*Parallel*.{java,kt,scala,cs,go,cpp,c,rs,py}",
"**/*Concurrent*.{java,kt,scala,cs,go,cpp,c,rs,py}",
"**/*Thread*.{java,kt,scala,cs,go,cpp,c,rs,py}",
"**/*Worker*.{java,kt,scala,cs,go,cpp,c,rs,py}"
],
"title": "%config.expertCodeEnhancerPromptList.concurrency%",
"prompt": "Refactor the following code to improve its concurrency and multithreading capabilities. Focus on efficient resource sharing, preventing race conditions, and enhancing overall parallel processing performance.",
"sort": 180,
"autoContext": true
}
],
"default": [],
"scope": "resource",
"markdownDescription": "%config.expertCodeEnhancerPromptList.description%"
},
Expand Down
5 changes: 3 additions & 2 deletions package.nls.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@
"config.codeViewerHelperPrompt.description": "Code viewer helper AI prompt template, [click to view online documentation](https://aide.nicepkg.cn/guide/configuration/code-viewer-helper-prompt)",
"config.expertCodeEnhancerPromptList.description": "Expert code enhancer AI prompt template list, [click to view online documentation](https://aide.nicepkg.cn/guide/configuration/expert-code-enhancer-prompt-list)",
"config.expertCodeEnhancerPromptList.solid": "Optimize using SOLID principles",
"config.expertCodeEnhancerPromptList.dry": "Apply DRY principle",
"config.expertCodeEnhancerPromptList.dry": "Optimize using DRY principles",
"config.expertCodeEnhancerPromptList.designPatterns": "Apply appropriate design patterns",
"config.expertCodeEnhancerPromptList.splitComponents": "Split into smaller components",
"config.expertCodeEnhancerPromptList.cleanliness": "Improve code cleanliness",
"config.expertCodeEnhancerPromptList.performance": "Optimize for performance",
"config.expertCodeEnhancerPromptList.databaseQueries": "Optimize database queries",
"config.expertCodeEnhancerPromptList.security": "Enhance security measures",
"config.expertCodeEnhancerPromptList.concurrency": "Optimize concurrency and multithreading",
"config.expertCodeEnhancerPromptList.optimizeConditionals": "if-else cleaning master",
"config.convertLanguagePairs.description": "Default convert language pairs, [click to view online documentation](https://aide.nicepkg.cn/guide/configuration/convert-language-pairs)",
"config.autoRememberConvertLanguagePairs.description": "Automatically remember convert language pairs, [click to view online documentation](https://aide.nicepkg.cn/guide/configuration/auto-remember-convert-language-pairs)",
"config.readClipboardImage.description": "Allow reading clipboard images as AI context in certain scenarios, [click to view online documentation](https://aide.nicepkg.cn/guide/configuration/read-clipboard-image)",
"config.aiPrompt.description": "Template for copied content, use `#{content}` as a placeholder for file content, [click to view online documentation](https://aide.nicepkg.cn/guide/configuration/ai-prompt)",
"config.aiPrompt.description": "Template for copied content, use `#{content}` as a variable for file content, [click to view online documentation](https://aide.nicepkg.cn/guide/configuration/ai-prompt)",
"config.ignorePatterns.description": "Ignored file name patterns, supports `glob` syntax, [click to view online documentation](https://aide.nicepkg.cn/guide/configuration/ignore-patterns)",
"config.respectGitIgnore.description": "Respect `.gitignore` file, [click to view online documentation](https://aide.nicepkg.cn/guide/configuration/respect-git-ignore)",
"config.aiCommand.description": "Custom `✨ Aide: Ask AI` command template. Available variables:` #{filesRelativePath}`, `#{filesFullPath}`, `#{content}`, [click to view online documentation](https://aide.nicepkg.cn/guide/configuration/ai-command)",
Expand Down
5 changes: 3 additions & 2 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@
"config.codeViewerHelperPrompt.description": "Code viewer helper AI prompt template, [click to view online documentation](https://aide.nicepkg.cn/guide/configuration/code-viewer-helper-prompt)",
"config.expertCodeEnhancerPromptList.description": "Expert code enhancer AI prompt template list, [click to view online documentation](https://aide.nicepkg.cn/guide/configuration/expert-code-enhancer-prompt-list)",
"config.expertCodeEnhancerPromptList.solid": "Optimize using SOLID principles",
"config.expertCodeEnhancerPromptList.dry": "Apply DRY principle",
"config.expertCodeEnhancerPromptList.dry": "Optimize using DRY principles",
"config.expertCodeEnhancerPromptList.designPatterns": "Apply appropriate design patterns",
"config.expertCodeEnhancerPromptList.splitComponents": "Split into smaller components",
"config.expertCodeEnhancerPromptList.cleanliness": "Improve code cleanliness",
"config.expertCodeEnhancerPromptList.performance": "Optimize for performance",
"config.expertCodeEnhancerPromptList.databaseQueries": "Optimize database queries",
"config.expertCodeEnhancerPromptList.security": "Enhance security measures",
"config.expertCodeEnhancerPromptList.concurrency": "Optimize concurrency and multithreading",
"config.expertCodeEnhancerPromptList.optimizeConditionals": "if-else cleaning master",
"config.convertLanguagePairs.description": "Default convert language pairs, [click to view online documentation](https://aide.nicepkg.cn/guide/configuration/convert-language-pairs)",
"config.autoRememberConvertLanguagePairs.description": "Automatically remember convert language pairs, [click to view online documentation](https://aide.nicepkg.cn/guide/configuration/auto-remember-convert-language-pairs)",
"config.readClipboardImage.description": "Allow reading clipboard images as AI context in certain scenarios, [click to view online documentation](https://aide.nicepkg.cn/guide/configuration/read-clipboard-image)",
"config.aiPrompt.description": "Template for copied content, use `#{content}` as a placeholder for file content, [click to view online documentation](https://aide.nicepkg.cn/guide/configuration/ai-prompt)",
"config.aiPrompt.description": "Template for copied content, use `#{content}` as a variable for file content, [click to view online documentation](https://aide.nicepkg.cn/guide/configuration/ai-prompt)",
"config.ignorePatterns.description": "Ignored file name patterns, supports `glob` syntax, [click to view online documentation](https://aide.nicepkg.cn/guide/configuration/ignore-patterns)",
"config.respectGitIgnore.description": "Respect `.gitignore` file, [click to view online documentation](https://aide.nicepkg.cn/guide/configuration/respect-git-ignore)",
"config.aiCommand.description": "Custom `✨ Aide: Ask AI` command template. Available variables:` #{filesRelativePath}`, `#{filesFullPath}`, `#{content}`, [click to view online documentation](https://aide.nicepkg.cn/guide/configuration/ai-command)",
Expand Down
5 changes: 3 additions & 2 deletions package.nls.zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@
"config.codeViewerHelperPrompt.description": "代码查看器助手 AI 提示词模板, [点击查看在线文档](https://aide.nicepkg.cn/zh/guide/configuration/code-viewer-helper-prompt)",
"config.expertCodeEnhancerPromptList.description": "大师代码优化 AI 提示词模板列表, [点击查看在线文档](https://aide.nicepkg.cn/zh/guide/configuration/expert-code-enhancer-prompt-list)",
"config.expertCodeEnhancerPromptList.solid": "使用 SOLID 原则优化",
"config.expertCodeEnhancerPromptList.dry": "应用 DRY 原则",
"config.expertCodeEnhancerPromptList.dry": "使用 DRY 原则优化",
"config.expertCodeEnhancerPromptList.designPatterns": "应用适当的设计模式",
"config.expertCodeEnhancerPromptList.splitComponents": "拆分为更小的组件",
"config.expertCodeEnhancerPromptList.cleanliness": "提高代码整洁度",
"config.expertCodeEnhancerPromptList.performance": "优化性能",
"config.expertCodeEnhancerPromptList.databaseQueries": "优化数据库查询",
"config.expertCodeEnhancerPromptList.security": "加强安全措施",
"config.expertCodeEnhancerPromptList.concurrency": "优化并发和多线程",
"config.expertCodeEnhancerPromptList.optimizeConditionals": "if-else 清理大师",
"config.convertLanguagePairs.description": "默认转换语言对照表, [点击查看在线文档](https://aide.nicepkg.cn/zh/guide/configuration/convert-language-pairs)",
"config.autoRememberConvertLanguagePairs.description": "是否自动记住转换语言对照表, [点击查看在线文档](https://aide.nicepkg.cn/zh/guide/configuration/auto-remember-convert-language-pairs)",
"config.readClipboardImage.description": "是否允许某些场景读取剪贴板图片作为 AI 上下文, [点击查看在线文档](https://aide.nicepkg.cn/zh/guide/configuration/read-clipboard-image)",
"config.aiPrompt.description": "复制内容的模板,使用 `#{content}` 作为文件内容的占位符, [点击查看在线文档](https://aide.nicepkg.cn/zh/guide/configuration/ai-prompt)",
"config.aiPrompt.description": "复制内容的模板,使用 `#{content}` 作为文件内容的变量, [点击查看在线文档](https://aide.nicepkg.cn/zh/guide/configuration/ai-prompt)",
"config.ignorePatterns.description": "忽略的文件名模式, 支持 `glob` 语法, [点击查看在线文档](https://aide.nicepkg.cn/zh/guide/configuration/ignore-patterns)",
"config.respectGitIgnore.description": "是否尊重 `.gitignore` 文件, [点击查看在线文档](https://aide.nicepkg.cn/zh/guide/configuration/respect-git-ignore)",
"config.aiCommand.description": "自定义 `✨ Aide: 问 AI` 命令模板。可用变量:`#{filesRelativePath}`、`#{filesFullPath}`、 `#{content}`, [点击查看在线文档](https://aide.nicepkg.cn/zh/guide/configuration/ai-command)",
Expand Down
Loading

0 comments on commit 0b24783

Please sign in to comment.