> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/documentation/zh/ji-cheng/visual-studio-code.md).

# Visual Studio Code（测试版）

{% hint style="warning" %}
此功能已不再在 GitBook 中维护，且可能会发生变化。
{% endhint %}

GitBook Visual Studio Code 集成可让你直接在代码编辑器中搜索文档和知识并提问。借助专用侧边栏和一系列不同命令，你可以轻松地直接在日常使用的工具中利用整个团队的知识。

### 安装与配置

你可以从以下位置安装 Visual Studio Code 集成： **集成** GitBook 应用中的界面，或从以下位置： [Visual Studio Code 扩展市场](https://marketplace.visualstudio.com/items?itemName=GitBook.gitbook-vscode).

将集成安装到 Visual Studio Code 后，你需要登录你的 GitBook 账户以完成配置。

{% hint style="warning" %}
GitBook Visual Studio Code 扩展仅适用于 [搭载 Apple 芯片的 Mac](https://support.apple.com/en-gb/HT211814) 以及当前的 Windows PC。
{% endhint %}

#### 1. 使用你的开发者令牌登录 GitBook

为了让 Visual Studio Code 访问 GitBook，你需要通过添加开发者令牌来授予你的 IDE 访问权限。你可以在你的 [开发者设置](https://app.gitbook.com/account/developer).

获得令牌后，你可以通过命令面板（⌘+⇧+P）将其添加到 Visual Studio Code 中，位于 **GitBook：登录 GitBook。**

#### 2. 选择你的 GitBook 组织

保存个人访问令牌后，你需要选择要将你的 [代码片段](broken://pages/8f827a24bfa63a32cc6f4b0cc10568c2e1f93b9b) 添加到其中的组织。

在命令面板中，你可以在以下选项下选择一个组织： **GitBook：切换组织** 选项。如果你只属于一个组织，它会已经为你选中。

### 询问关于你的 GitBook 文档的问题

使用 GitBook VS Code 扩展，你可以在侧边栏中提出上下文相关的问题，以访问你团队的知识。此部分还包含你团队成员最近的代码片段列表，因此你可以快速查看他人从 VS Code 保存到团队知识库中的内容。

要调出信息，只需打开 GitBook 面板并在搜索栏中输入你的查询。你将获得基于你的 GitBook 组织中的信息生成的摘要结果。

{% hint style="info" %}
此功能需要 [GitBook AI 搜索（测试版）](/docs/documentation/zh/creating-content/searching-your-content/gitbook-ai.md) 在你的组织中启用。
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gitbook.com/docs/documentation/zh/ji-cheng/visual-studio-code.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
