|
1 | 1 | # CodeReDesign |
2 | 2 |
|
3 | | -**CodeReDesign** 是一个 VSCode 插件,旨在配合DeepSeek API。帮助开发者更高效地进行代码重构和重新设计。通过提供文件选择、代码合并文件生成、SeepSeek API 上传和接收,本地代码应用,CodeReDesign 让代码重构变得更加简单和流畅。 |
| 3 | +**CodeReDesign** is a VSCode extension designed to work with the DeepSeek API. It helps developers perform code refactoring and redesign more efficiently. By providing file selection, code merging into a unified markdown file, uploading and receiving suggestions via the DeepSeek API, and local application of code changes, CodeReDesign simplifies and streamlines the refactoring process. |
| 4 | + |
| 5 | +**CodeReDesign** 是一个 VSCode 插件,旨在配合 DeepSeek API,帮助开发者更高效地进行代码重构和重新设计。通过提供文件选择、代码合并为统一的 markdown 文件、上传和接收 DeepSeek API 的重构建议,并在本地应用代码变更,CodeReDesign 使得代码重构变得更加简单和流畅。 |
4 | 6 |
|
5 | 7 | --- |
6 | 8 |
|
7 | | -## 功能特性 |
| 9 | +## Features / 功能特性 |
| 10 | + |
| 11 | +- **File Selector**: Select multiple source files in the current working directory and merge them into a unified CVB file (markdown format). |
| 12 | +- **API Call**: Upload the CVB file to DeepSeek API and get refactoring suggestions. |
| 13 | +- **Version Management**: Supports tracking the history of multiple refactor versions. CVB files can be applied locally or rolled back. |
| 14 | +- **Multi-language Support**: Supports multiple programming languages including C++, Python, Lua, TypeScript, etc. |
8 | 15 |
|
9 | | -- **文件选择器**:支持选择当前工作目录下的多个源文件,打包成一个统一的类markdown文件(CVB格式)。 |
| 16 | +- **文件选择器**:支持选择当前工作目录下的多个源文件,并将其合并为统一的 CVB 文件(markdown 格式)。 |
10 | 17 | - **API 调用**:上传 CVB 文件并调用 DeepSeek API,获取重构建议。 |
11 | | -- **版本管理**:支持多个次重构的历史记录, CVB 在本地可选应用和回滚。 |
| 18 | +- **版本管理**:支持多个次重构的历史记录,CVB 文件可以在本地应用或回滚。 |
12 | 19 | - **多语言支持**:支持 C++、Python、Lua、TypeScript 等多种编程语言。 |
13 | 20 |
|
14 | | -## 使用方法 |
| 21 | +## Usage / 使用方法 |
| 22 | + |
| 23 | +#### Before using, you need to set the DeepSeek API Key |
| 24 | +Go to `File -> Preferences -> Settings` (文件 -> 首选项 -> 设置). |
| 25 | + |
| 26 | +Search for `coderedesign`. |
| 27 | + |
| 28 | +Enter your DeepSeek API Key in the **Deep Seek Api Key** field. |
15 | 29 |
|
16 | | -#### 使用前需要先设置DeepSeek API 的Key |
17 | | -File -> Preferences -> Settings(文件 -> 首选项 -> 设置) |
| 30 | +#### Commands / 指令: |
18 | 31 |
|
19 | | -搜索 coderedesign |
| 32 | +1. **codeReDesign.generateCvb** (Generate CVB File) |
| 33 | + - Package the code that needs refactoring into CVB format. |
| 34 | + - Select the files you need and press enter. |
| 35 | + - Enter a version name, for example "Initial Version of Multi-process Refactoring". |
| 36 | + - A timestamped CVB file (e.g., `timestamp-versionName.cvb`) will be created in the `.CodeReDesignWorkSpace` directory. This file can be viewed in markdown format. |
| 37 | + |
| 38 | +2. **codeReDesign.uploadCvb** (Upload CVB File) |
| 39 | + - Select a CVB file that has already been created locally and upload it to DeepSeek. |
| 40 | + - Enter a prompt for the refactoring request, such as "Refactor these multi-process codes into multi-threading, and change the inter-process communication standard input-output handles to lock-free queues". |
| 41 | + - DeepSeek will process the request and provide refactoring suggestions. You can see the intermediate steps in the output box. |
| 42 | + - Once done, a new CVB file will be created locally. |
| 43 | + |
| 44 | +3. **codeReDesign.applyCvb** (Apply CVB File) |
| 45 | + - After reviewing the suggestions, you can apply the CVB file by using this command. |
| 46 | + - It will overwrite the local files with the refactored code as described in the CVB file. |
| 47 | + |
| 48 | +--- |
20 | 49 |
|
21 | | -在 Deep Seek Api Key(DeepSeek API 密钥) |
22 | | -里填写你在DeepSeek哪里申请到的Key |
| 50 | +#### 示例指令: |
23 | 51 |
|
24 | | -#### 指令: |
25 | | -ctrl + shift + p 打开指令菜单(Command Palette),有以下几个指令可用 |
| 52 | +1. **codeReDesign.generateCvb**(生成 CVB 文件) |
| 53 | + - 打包需要重构的代码为 CVB 格式。 |
| 54 | + - 选中你需要的文件,回车。 |
| 55 | + - 给这些文件取一个版本名,比如输入 "准备重构多进程-初始版本"。 |
| 56 | + - 会在本地 `.CodeReDesignWorkSpace` 目录下生成一个时间戳+版本名的 `.cvb` 文件,可以使用 markdown 格式查看。 |
26 | 57 |
|
27 | | -1. codeReDesign.generateCvb(生成 CVB 文件) |
28 | | -打包需要重构的代码为 CVB 格式 |
29 | | -选中你需要的文件,回车 |
30 | | -给这些文件取一个版本名,比如输入 "准备重构多进程-初始版本" |
31 | | -会在本地 .CodeReDesignWorkSpace 目录下生成一个 时间戳+版本名.cvb 的文件,可以使用 markdown 格式查看 |
| 58 | +2. **codeReDesign.uploadCvb**(上传 CVB 文件) |
| 59 | + - 选择一个本地已经打包好的 CVB 格式文件,上传到 DeepSeek。 |
| 60 | + - 输入你希望重构的提示词,比如 "把这些代码里的多进程重构为多线程,注意要把进程间通讯的标准输出输入句柄改为无锁队列"。 |
| 61 | + - DeepSeek 会开始帮你重构,你可以在输出框看到中间过程。 |
| 62 | + - 输出完毕,会在本地创建一个新的 CVB 格式文件。 |
32 | 63 |
|
33 | | -2. codeReDesign.uploadCvb(上传 CVB 文件) |
34 | | -选择一个本地已经打包好的 CVB 格式文件,上传到 DeepSeek |
35 | | -输入你希望重构的提示词,比如 "把这些代码里的多进程重构为多线程,注意要把进程间通讯的标准输出输入句柄改为无锁队列" |
36 | | -然后 DeepSeek 就会开始帮你重构,你可以在输出框看到中间过程 |
37 | | -输出完毕,会在本地创建一个新的 CVB 格式文件 |
| 64 | +3. **codeReDesign.applyCvb**(应用 CVB 文件) |
| 65 | + - 如果查看后觉得没问题,可以用这个指令。 |
| 66 | + - 将这个 CVB 格式文件展开并覆盖本地文件。 |
38 | 67 |
|
39 | | -3. codeReDesign.applyCvb(应用 CVB 文件) |
40 | | -如果查看后觉得没问题,可以用这个指令 |
41 | | -将这个 CVB 格式文件展开覆盖本地文件 |
|
0 commit comments