-
-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
072d54b
commit 3cdaba1
Showing
17 changed files
with
240 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
website/en/guide/configuration/expert-code-enhancer-prompt-list.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# aide.expertCodeEnhancerPromptList | ||
|
||
This configuration allows you to customize ==the AI prompt list for expert code enhancement==. | ||
|
||
With these prompts, you can specify how to optimize and refactor your code. Prompts can be customized to match specific files based on file path patterns. | ||
|
||
**Prompt Configuration Fields:** | ||
|
||
| Field | Description | Required | Default | | ||
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | | ||
| `match` | File path matching pattern, supports [glob](https://github.com/isaacs/node-glob) syntax. The prompt will only be displayed if the current file path matches. | No | `"**/*"` | | ||
| `title` | Title of the prompt, displayed in the selection list. | Yes | | | ||
| `prompt` | Content of the prompt, describing the optimization operation needed. | Yes | | | ||
| `sort` | Sorting weight, the smaller the number, the higher it ranks. | No | `1000` | | ||
| `autoContext` | Whether to enable automatic context support. When enabled, AI will also read files potentially related to the current file before processing the code. Defaults to `false`. Requires the `function_call` feature. | No | `false` | | ||
|
||
**Usage Example:** | ||
|
||
```json | ||
{ | ||
"aide.expertCodeEnhancerPromptList": [ | ||
{ | ||
"match": ["**/*.sql", "**/*Repository.{java,kt,scala,cs,py,js,ts}"], | ||
"title": "Optimize Database Queries", | ||
"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.", | ||
"autoContext": true | ||
}, | ||
{ | ||
"match": ["**/*.vue", "**/*.tsx", "**/*.jsx"], | ||
"title": "Split Into Smaller Components", | ||
"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.", | ||
"autoContext": true | ||
}, | ||
{ | ||
"match": "**/*", | ||
"title": "Optimize Using DRY Principles", | ||
"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.", | ||
"autoContext": false | ||
} | ||
] | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Expert Code Enhancer | ||
|
||
Command Name: `aide.expertCodeEnhancer` | ||
|
||
Use AI to optimize and refactor the entire file or selected code. Supports multiple programming languages. | ||
|
||
::: warning Warning | ||
|
||
This feature sometimes requires AI models that support the `function_call` capability. | ||
|
||
::: | ||
|
||
**Scenarios:** | ||
|
||
- When inheriting a legacy project, you want to optimize hard-to-read code. | ||
- Helps you clean up and refactor legacy code to make it more readable. | ||
- You want to improve your own coding skills. | ||
- Helps you refactor code following principles like SOLID and DRY. | ||
- Automatically applies appropriate design patterns to your code. | ||
- Automatically checks and fixes security vulnerabilities in your code. | ||
- Automatically detects and optimizes performance issues in your code. | ||
- Allows custom AI optimization prompts for specific files, replacing many traditional code handling scripts. | ||
|
||
**Usage:** | ||
|
||
- Select the code in the editor. | ||
- Click the pencil icon at the top right or right-click and select `✨ Aide: Expert Code Enhancer`. | ||
|
||
::: tip | ||
If the output is interrupted, you can click the original pencil icon or right-click and select `✨ Aide: Expert Code Enhancer` to continue. | ||
::: | ||
|
||
<Video src="/videos/aide-expert-code-enhancer.mp4"/> | ||
|
||
**Related Configuration:** | ||
|
||
- You can customize the corresponding AI prompt templates by configuring [`aide.expertCodeEnhancerPromptList`](../configuration/expert-code-enhancer-prompt-list.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.