unit-mesh / auto-dev-vscode

AutoDev - 🧙‍the AI-powered coding wizard . Put the most loved AutoDev AI assistant into your VSCode, and have things done quickly
http://vscode.unitmesh.cc/
MIT License
234 stars 38 forks source link

When the chat is opened via the shortcut (ctrl + l) or the menu, the selected code is automatically added to the chat panel. #69

Closed meteor199 closed 2 months ago

meteor199 commented 2 months ago

当按ctrl +l 或在菜单中点击聊天时,自动将所选代码添加到聊天窗口

zhengxs2018 commented 2 months ago

ChatView 功能扩展

ChatView 区分了对编辑器的功能支持:

示例

发送代码和提示

如果需要在聊天窗口显示代码和提示,可以使用以下方法:

通过以上流程,可以实现代码解释和代码优化的功能。

改进建议

相比于改造 showPanel,我更希望 ChatView 能有以下方法:

或者 ChatView 方法支持 filecode 参数。

修改建议

可以参考 AutoDevCodeLensProvider,并区分命令注册的范围:

快捷键可以直接调用 autodev.chat.show

关联文件位置

meteor199 commented 2 months ago

快捷键命令是否可以使用:autodev.quickChatautodev.chatWithCodeautodev.focusInput

名称叫 快速聊天或 添加选中代码到聊天

zhengxs2018 commented 2 months ago

autodev.quickChatautodev.chatWithCode

可以,但 autodev.focusInput 感觉怪怪的,如果做全键盘支持那就是独立功能,比如:

  1. 使用键盘聚焦到 VS Code 的「侧边活动栏」,然后激活「对话视图」
  2. 使用键盘,用快捷键 「聚焦输入框」
  3. 输入内容回车

可以作为下一个功能的考虑吧,我看好多人已经习惯键盘,不用鼠标了

meteor199 commented 2 months ago

此次修改主要增添了 autodev.quickChat 命令。在按下 Ctrl + L 和通过菜单点击“Start Chat”时,利用此命令取代原来的 autodev.showChatPanel。