- 将 package.json 中的版本号从 0.0.2 修改为 0.0.5 - 在 package.json 的 scripts 中添加 package 命令,用于打包扩展 - 更新 package-lock.json 中的版本号和依赖信息 |
6 months ago | |
|---|---|---|
| .idea | 7 months ago | |
| .vscode | 7 months ago | |
| media | 6 months ago | |
| src | 6 months ago | |
| .gitignore | 6 months ago | |
| .npmrc | 7 months ago | |
| .vscode-test.mjs | 7 months ago | |
| .vscodeignore | 6 months ago | |
| CHANGELOG.md | 7 months ago | |
| README.md | 6 months ago | |
| eslint.config.mjs | 7 months ago | |
| package-lock.json | 6 months ago | |
| package.json | 6 months ago | |
| tsconfig.json | 6 months ago | |
| tsconfig.tsbuildinfo | 7 months ago | |
| vsc-extension-quickstart.md | 7 months ago | |
README.md
AI Chat
AI Chat 是一个 Visual Studio Code 扩展,允许您直接从状态栏打开 AI 聊天 Webview 面板。通过这个扩展,您可以方便地与 AI 进行交互,而无需离开编辑器环境。
功能特性
- 状态栏快速访问:通过点击状态栏按钮快速打开 AI 聊天面板
- 代码上下文支持:可以将当前文件作为上下文发送给 AI
- 代码片段交互:选中代码后通过右键菜单将代码添加到对话中
- 智能代码差异对比:AI 提供的代码修改将以差异对比形式展示
- 工作区文件管理:可以接受或拒绝 AI 建议的代码变更
- 辅助侧边栏集成:在 VS Code 的辅助侧边栏中直接使用 AI Chat
使用方法
- 安装扩展后,您会在 VS Code 状态栏看到一个 "AI Chat" 按钮
- 点击按钮打开聊天面板
- 可以通过以下方式提供上下文:
- 点击面板中的 "+" 按钮选择文件作为上下文
- 在编辑器中选中代码,右键选择"添加至对话"
- 输入您的问题并与 AI 进行交互
- 如果 AI 提供了代码修改建议,您可以:
- 查看代码差异
- 接受或拒绝变更
扩展命令
ai-chat.openWebview:打开 AI Chat 面板extension.addToChat:将选中的代码添加到对话中
快捷操作
- 右键菜单:在编辑器中选中代码后,可通过右键菜单快速添加到对话
- 状态栏按钮:点击状态栏的 "AI Chat" 按钮快速打开面板
技术细节
本扩展使用以下技术构建:
- highlight.js:代码高亮显示
- marked:Markdown 渲染
- diff:代码差异计算
扩展通过 Webview 技术实现富交互界面,并与 AI 后端服务通信以提供智能代码辅助功能。
注意事项
此扩展需要访问 AI 后端服务才能正常工作。默认配置使用内部测试服务,实际使用时可能需要配置自己的 API 服务地址。
Requirements
If you have any requirements or dependencies, add a section describing those and how to install and configure them.
Extension Settings
Include if your extension adds any VS Code settings through the contributes.configuration extension point.
For example:
This extension contributes the following settings:
myExtension.enable: Enable/disable this extension.myExtension.thing: Set toblahto do something.
Known Issues
Calling out known issues can help limit users opening duplicate issues against your extension.
Release Notes
Users appreciate release notes as you update your extension.
1.0.0
Initial release of ...
1.0.1
Fixed issue #.
1.1.0
Added features X, Y, and Z.
Following extension guidelines
Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.
Working with Markdown
You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
- Split the editor (
Cmd+\on macOS orCtrl+\on Windows and Linux). - Toggle preview (
Shift+Cmd+Von macOS orShift+Ctrl+Von Windows and Linux). - Press
Ctrl+Space(Windows, Linux, macOS) to see a list of Markdown snippets.
For more information
Enjoy!