Merge pull request #82 from devchat-ai/docs/add-input-field-desc-#312

Update Workflow Command Documentation to Include 'input' Field Descriptions
This commit is contained in:
Rankin Zheng 2024-03-30 00:41:37 +08:00 committed by GitHub
commit e3cb0725a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 111 additions and 0 deletions

13
comments/README.md Normal file
View File

@ -0,0 +1,13 @@
需要输入参数,使用指南如下:
## 1.选中代码
选中你需要注释的代码,右键唤出菜单,点击"DevChat: Generate Comments"向AI助手发起求。或者在DevChat聊天窗口键入/comments 直接发起行间注释工作流。
![图片](https://deploy-script.merico.cn/devchat/workflow/comments_1.png)
![图片](https://deploy-script.merico.cn/devchat/workflow/comments_2.png)
## 2.生成注释
等待结果,而后进行差异比对。
![图片](https://deploy-script.merico.cn/devchat/workflow/comments_3.gif)
## 3.比对差异
生成结束后,工作流会自动调用差异比对界面。你可以看到注释代码的差异,接受他们或者逐行比对。
![图片](https://deploy-script.merico.cn/devchat/workflow/comments_4.png)

View File

@ -1,3 +1,4 @@
description: Automatically add doc comments. Select some code and execute this command to generate comments.
input: required
steps:
- run: $devchat_python $command_path/main.py

18
docstring/README.md Normal file
View File

@ -0,0 +1,18 @@
需要输入参数,使用指南如下:
## 1.选中代码
选中你需要注释的函数,点击函数头部的"docstring"按钮,向 AI 助手发起求。或者在 DevChat 聊天窗口,键入/docstring 直接发起文档注释工作流。
![图片](https://deploy-script.merico.cn/devchat/workflow/docstring_1.png)
![图片](https://deploy-script.merico.cn/devchat/workflow/docstring_2.png)
## 2.生成文档
等待结果,而后进行差异比对。
![图片](https://deploy-script.merico.cn/devchat/workflow/docstring_3.gif)
## 3.比对差异
生成结束后,工作流会自动调用差异比对界面。你可以看到注释代码的差异,接受他们或者逐行比对。
![图片](https://deploy-script.merico.cn/devchat/workflow/docstring_4.png)

View File

@ -1,3 +1,4 @@
description: Automatically add docstrings. Select a function or method and execute this command to generate docstring.
input: required
steps:
- run: $devchat_python $command_path/main.py

15
explain/README.md Normal file
View File

@ -0,0 +1,15 @@
需要输入参数,使用指南如下:
## 1.选中代码
选中你需要解释的代码,右键唤出菜单,点击"DevChat: Generate Explain",向 AI 助手发起解释请求。或者再 DevChat 聊天窗口,键入/explain 直接发起代码解释工作流。
![图片](https://deploy-script.merico.cn/devchat/workflow/explain_1.png)
![图片](https://deploy-script.merico.cn/devchat/workflow/explain_2.png)
如果你是希望解释整个函数还可以点击函数头部的“explain”按钮发起请求。
![图片](https://deploy-script.merico.cn/devchat/workflow/explain_3.png)
## 2.开始解释
此时,你只需要等待结果即可。
![图片](https://deploy-script.merico.cn/devchat/workflow/explain_4.gif)

View File

@ -1,3 +1,4 @@
description: Explain selected code.
input: required
steps:
- run: $devchat_python $command_path/explain.py

17
fix/README.md Normal file
View File

@ -0,0 +1,17 @@
需要输入参数,使用指南如下:
## 1.选中代码
选中你需要纠错的代码右键唤出菜单点击“DevChatFix this”。或者在 DevChat 聊天窗口,键入/fix 直接发起代码纠错工作流。
![图片](https://deploy-script.merico.cn/devchat/workflow/fix_1.png)
## 2.分析代码
开始生成以后AI 会根据选中的代码,对命名规范、代码格式、逻辑错误等给出自己的优化意见。生成结束以后,还会调用 DevChat 的差异比对界面,方便用户查看修改点。
![图片](https://deploy-script.merico.cn/devchat/workflow/fix_2.gif)
## 3.比对差异
在差异对比界面,您可以点击 DevChat 图标接受修改,或者逐行查看变更。
![图片](https://deploy-script.merico.cn/devchat/workflow/fix_3.png)

View File

@ -1,3 +1,4 @@
description: Try to find out potential bugs in the selected code and try fixing these bugs automaticly.
input: required
steps:
- run: $devchat_python $command_path/main.py

17
refactor/README.md Normal file
View File

@ -0,0 +1,17 @@
需要输入参数,使用指南如下:
## 1.选中代码
选中你需要重构的代码,在 DevChat 聊天窗口,键入/refactor 发起代码重构工作流。
![图片](https://deploy-script.merico.cn/devchat/workflow/refactor.name_1.png)
## 2.生成代码
此时,你只需要等待结果即可。等给出自己的优化意见。生成结束以后,自动调用 DevChat 的差异比对界面,方便用户查看修改点。
![图片](https://deploy-script.merico.cn/devchat/workflow/refactor.name_2.gif)
## 3.对比差异
在差异对比界面,您可以点击 DevChat 图标接受修改,或者逐行查看变更。
![图片](https://deploy-script.merico.cn/devchat/workflow/refactor.name_3.png)

26
unit_tests/README.md Normal file
View File

@ -0,0 +1,26 @@
需要输入参数,使用指南如下:
## 1.生成测试用例
点击函数头部"unit tests"按钮,触发代码分析。工作流会收集该函数相关的变量定义、相关测试文件等信息用于生成 6 个推荐的测试用例,包括 3 个正常路径3 个边界条件。
![图片](https://deploy-script.merico.cn/devchat/workflow/unit_tests_1.png)
## 2.选择测试用例
当测试用例生成完毕,你可以选择你觉得有意义的测试用例,进行下一步操作。
![图片](https://deploy-script.merico.cn/devchat/workflow/unit_tests_2.png)
## 4.输入控制信息
如果你认为推荐的测试用例不能满足你的测试要求,也可以通过输入框补充你的测试需求。必要的话可以修改参考文件到你喜欢的文件。最后,补充一些要求,例如期望使用的测试框架等等。
![图片](https://deploy-script.merico.cn/devchat/workflow/unit_tests_3.png)
最后,点击 Submit 按钮开始生成单元测试。
## 5.生成测试代码
DevChat 会生成一份完整的文件,包含刚才选择的测试用例。一般情况下,这可能比较适合新文件的覆盖,当然你也可以拷贝其中的部分代码。
![图片](https://deploy-script.merico.cn/devchat/workflow/unit_tests_4.png)
代码块的右上角提供了一些便捷操作,包括插入代码、拷贝代码、查看代码变动等。
![图片](https://deploy-script.merico.cn/devchat/workflow/unit_tests_5.png)
选定代码以后,就可以进行单元测试的运行了。

View File

@ -1,3 +1,4 @@
description: Generate unit tests.
input: required
steps:
- run: $devchat_python $command_path/main.py "$input"