文心快码 - Baidu Comate
Coding Mate Powered by AI
基于AI的智能代码生成让你的编码更快、更好、更简单!
Enhance your coding experience with an AI-powered assistant for faster, better, and simpler coding!
Baidu Comate
由文心大模型 ERNIE-Code
提供技术支持,通过对百度多年积累的非涉密代码数据和 GitHub
头部公开代码数据进行训练,为您自动生成完整的、且更符合实际研发场景的代码行或整个代码块,帮助每一位开发者轻松完成研发任务。
Powered by Baidu's large-scale model "ERNIE-Code", Baidu Comate provides technical support by leveraging years of accumulated non-sensitive code data from Baidu and top open-source code data from GitHub. It automatically generates complete and contextually relevant lines or entire code blocks, assisting developers in effortlessly accomplishing development tasks.
快速开始 Quick Start
在官网申请或者在百度智能云购买License
,然后在插件设置中配置该License
和用户名称
Apply on the official website or purchase a License from BAIDU AI CLOUD, then configure the License and user name in the plugin settings.
支持能力:
Supported Features:
单行推荐 Single Line Completions
编码过程中稍做停顿,Comate即可按照它的理解,给你补全整行代码。
During the coding process, Comate suggests completing entire lines of code based on its understanding when there's a brief pause.
多行代码块推荐 Multi-line Completions
当待触发推荐的上下文,具备明显的完整逻辑关系(如一个新的方法、函数、判断、循环体等),可自动推荐一个逻辑完整的代码块。
When the context for completions is clear, such as a new method, function, conditional statement, or loop, Comate automatically suggest a logically complete code block.
多条推荐自由切换 Switching between Multiple Completions
如期望查看更多推荐内容,可通过快捷键快速切换,也可打开多条推荐面板,选择最满意的一条并采纳。
Easily toggle between multiple completions through keyboard shortcuts or by opening multiple completions panels and selecting the most suitable one.
自然语言生成代码对话界面 Chat Interface for Natural Language to Code
输入自然语言描述,Comate为你生成代码(⌘Y 打开对话界面)。
Type a natural language description, and Comate generates code for you (⌘Y to Chat).
生成函数注释与行间注释 Generate Docstring and Inline Comments
分析一个方法、函数、类,生成符合规范的文档注释,同时也可以识别函数中复杂逻辑逐行增加注释。
Analyze methods, functions, and classes to generate standardized documentation comments, and can also recognize and add comments line by line for complex logic within functions.
生成单元测试 Generate Unit Tests
针对一段函数(方法),生成其对应的单元测试代码。
Generate corresponding unit test code for a given function or method.
代码优化 Code Optimization
支持对长函数等复杂问题代码进行优化
Support optimization of complex problem codes, including long function codes etc.
代码修复 Code Fixing
识别代码中的潜在错误,并自动进行修复
Identify potential errors in the code and automatically apply fixes.
使用方式:
Usage:
- 选中所推荐代码:Tab
- 切换下一条推荐:alt/option+]
- 切换上一条推荐:alt/option+[
- 关闭当条推荐:Esc
- 查看所有推荐结果:鼠标hover到推荐内容后,显示Comate工具栏,点击 “Comate: 生成更多补全”,在侧边栏中选中采纳
- 打开自然语言生成代码界面:⌘Y
如以上快捷键与你的其他常用操作冲突,可通过Keyboard Shortcuts[⌘K ⌘S] 修改快捷键。
- Accept current Suggestion: Tab
- Switch to the next Suggestion: alt/option+]
- Switch to the previous Suggestion: alt/option+[
- Hide current Suggestion: Esc
- View all Suggestions: Hover over the Inline Suggestion content to display the Comate toolbar, click "Comate: Generate More Inline Completion," and select the desired suggestion from the sidebar.
- Open Chat panel: ⌘Y
If the above shortcuts conflict with your other commonly used operations, you can modify the shortcuts through Keyboard Shortcuts [⌘K ⌘S].
FAQ:
Baidu Comate 支持哪些语言? Which languages does Baidu Comate support?
Baidu Comate
支持C/C++
、Java
、Python
、Go
、JavaScript
、TypeScript
、Rust
、PHP
、Kotlin
、ObjectC
等100+主流编程语言。
Baidu Comate supports 100+ mainstream programming languages including C/C++, Java, Python, Go, JavaScript, TypeScript, Rust, PHP, Kotlin, ObjectC, etc.
是否会上传代码?上传哪些代码? Does Baidu Comate upload code? What kind of code is uploaded?
正常使用Baidu Comate
过程中需要利用正在编写的文件中的上文以及其他相关文件,来推理出接下来的下文。因此确实会需要通过网络将正在编写的代码文件内容传输给模型推理。我们承诺不使用这部分上传的代码做任何积累、分析、加工等后续动作。
During normal usage of Baidu Comate, it needs to utilize the context from the file being written and other related files to infer the subsequent context. Hence, it does require transmitting the content of the currently edited code file over the network for model inference. We commit not to use the uploaded code for any accumulation, analysis, processing, or subsequent actions.