尝试以扩展 VS Code 中的代理模式!

开源 AI 代码编辑器

下载 Visual Studio Code

使用 VS Code 即表示您同意其许可证隐私声明

适用于任何团队的任何模型

开箱即用地使用 Claude Sonnet 等 AI 模型,或者通过自备密钥访问 Azure、Anthropic、Google、Ollama、OpenAI 和 OpenRouter 的模型。

Dropdown menu in GitHub Copilot Chat displaying AI model options: 'Claude 3.7 Sonnet' selected, with other options like 'Claude 3.5 Sonnet', 'GPT 4.5', 'GPT 4o', and 'Manage Models...' Dropdown menu in GitHub Copilot Chat displaying AI model options: 'Claude 3.7 Sonnet' selected, with other options like 'Claude 3.5 Sonnet', 'GPT 4.5', 'GPT 4o', and 'Manage Models...'

您的代码库专家

您的代码库在本地和远程(在 GitHub 上)均已编入索引,以理解相关内容,从而实现快速、上下文感知的交互。

A VS Code chat prompt. The prompt includes codebase and file context by writing #codebase and #file:HistoryView.swift in the message. A VS Code chat prompt. The prompt includes codebase and file context by writing #codebase and #file:HistoryView.swift in the message.

以您的团队方式工作的 AI

使用自定义指令和可重用提示文件个性化交互,以适应您的工作流程、工具和项目。

Settings JSON for copilot instructions, the first set to `use React functional components', then including another file for extra instructions 'code-style.md'. Settings JSON for copilot instructions, the first set to `use React functional components', then including another file for extra instructions 'code-style.md'.

免费使用 VS Code 中的 AI 功能

无需试用。无需信用卡。只需您的 GitHub 帐户。

免费试用

代理模式

处理复杂、多步的任务。代理模式会读取您的代码库,跨文件建议修改,运行终端命令,并响应编译或测试失败——所有这些都循环进行,直到任务完成。通过 VS Code 扩展和模型上下文协议 (MCP) 服务器进一步优化代理模式,使其适应您的团队工作流程。

使用代理模式构建
VS Code window showing a code editor with projects.tsx open, alongside a chat panel in Agent mode. The chat discusses an open issue from GitHub. VS Code window showing a code editor with projects.tsx open, alongside a chat panel in Agent mode. The chat discusses an open issue from GitHub.

下一步编辑建议

当您编写代码时,VS Code 会预测您的下一步操作。使用 Tab 键直接在编辑器中接受 AI 驱动的建议。它会根据您正在进行的编辑智能地推荐要更改的内容和位置。

使用 AI 驱动的建议编写代码
Code editor showing a JavaScript file post.js. It defines a render method that renders a social media post by calling an external API. Next edit suggestions is suggesting how to complete the implementation. Code editor showing a JavaScript file post.js. It defines a render method that renders a social media post by calling an external API. Next edit suggestions is suggesting how to complete the implementation.

使用任何语言编写代码

VS Code 支持几乎所有主流编程语言。许多语言(如 JavaScript、TypeScript、CSS 和 HTML)已内置支持,但其他语言的扩展可以在 VS Code 市场中找到。

JavaScript 图标JavaScript
TypeScript 图标TypeScript
Python 图标Python
C# 图标C#
C++ 图标C++
HTML 图标HTML
Java 图标Java
JSON 图标JSON
PHP 图标PHP
Markdown 图标Markdown
Powershell 图标Powershell
YAML 图标YAML

完全可自定义

自定义您的 VS Code UI 和布局,使其适合您的编码风格。

颜色主题允许您修改 VS Code 用户界面中的颜色,以适应您的偏好和工作环境。

设置同步使您能够通过设置同步功能在您的 VS Code 实例之间共享用户设置。

配置文件允许您创建自定义设置集,并快速在它们之间切换或与他人共享。

Selecting the GitHub Dark theme with a quick pick Selecting the GitHub Dark theme with a quick pick

随时随地编写代码

无论您连接到云端、远程仓库,还是通过 VS Code for Web (vscode.dev) 在浏览器中,都可以在您最富有成效的地方编写代码。

内置源代码控制提供开箱即用的 Git 支持。许多其他源代码控制提供程序可通过扩展获得。

GitHub Codespaces为任何活动提供云驱动的开发环境——无论是长期项目,还是像审查拉取请求这样的短期任务。

vscode.dev in an Edge browser tab vscode.dev in an Edge browser tab

丰富的功能助您编写代码

编辑器远不止这些。无论是使用内置功能还是丰富的扩展,总有一款适合您。