> For the complete documentation index, see [llms.txt](https://chainide.gitbook.io/chainide-chinese/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chainide.gitbook.io/chainide-chinese/4.-chainide-quan-ti-bu-ju/2.9.-ai-code-sage-mo-kuai.md).

# 2.9. AI - Code Sage 模块

{% embed url="<https://www.youtube.com/watch?v=awJ2UqnljQM>" %}

## 1. 使用插件

用户右侧边栏会显示插件，点击插件即可展开插件功能菜单。

ChainIDE Code Sage 目前支持五项功能：

* Commentator：为代码添加注释。
* DeCommentator：为代码删除注释。
* Advisor：提供代码优化改进建议。
* Refactorer：识别和修复代码缺陷问题。
* Code Generator：以对话的形式生成您需要的代码。

<figure><img src="/files/W2ewQ3g5ZLUQUXZkuzVL" alt=""><figcaption></figcaption></figure>

## 2. 全局使用

用户可以**点击右侧四个按钮**，快速对**当前打开的文件中的全部代码**进行相对应的操作，如，点击按钮为智能合约提供详细的注释：

<figure><img src="/files/yv434d2qlQZaahIHHmv4" alt=""><figcaption></figcaption></figure>

## 3. 局部操作

用户也可以**选中需要操作的代码块**，**右键打开快捷操作**，用户可以选择自己想要进行的操作。

<figure><img src="/files/uoU86abWRJSwJgZgyRwX" alt=""><figcaption><p><br></p></figcaption></figure>
