vscode

应用程序

microsoft/vscode

VS Code 是微软开发的跨平台开源代码编辑器。

项目简介

Visual Studio Code 结合了代码编辑器的简洁性和强大的开发功能,如调试、任务运行和版本控制。它基于 Electron 构建,并支持丰富的扩展生态系统。

README 预览

# Visual Studio Code - Open Source ("Code - OSS")
[](https://github.com/microsoft/vscode/issues?q=is%3Aopen+is%3Aissue+label%3Afeature-request+sort%3Areactions-%2B1-desc)
[](https://github.com/microsoft/vscode/issues?utf8=✓&q=is%3Aissue+is%3Aopen+label%3Abug)
[](https://gitter.im/Microsoft/vscode)

## The Repository

This repository ("`Code - OSS`") is where we (Microsoft) develop the [Visual Studio Code](https://code.visualstudio.com) product together with the community. Not only do we work on code and issues here, but we also publish our [roadmap](https://github.com/microsoft/vscode/wiki/Roadmap), [monthly iteration plans](https://github.com/microsoft/vscode/wiki/Iteration-Plans), and our [endgame plans](https://github.com/microsoft/vscode/wiki/Running-the-Endgame). This source code is available to everyone under the standard [MIT license](https://github.com/microsoft/vscode/blob/main/LICENSE.txt).

## Visual Studio Code

  

[Visual Studio Code](https://code.visualstudio.com) is a distribution of the `Code - OSS` repository with Microsoft-specific customizations released under a traditional [Microsoft product license](https://code.visualstudio.com/License/).

[Visual Studio Code](https://code.visualstudio.com) combines the simplicity of a code editor with what developers need for their core edit-build-debug cycle. It provides comprehensive code editing, navigation, and understanding support along with lightweight debugging, a rich extensibility model, and lightweight integration with existing tools.

Visual Studio Code is updated monthly with new features and bug fixes. You can download it for Windows, macOS, and Linux on [Visual Studio Code's website](https://code.visualstudio.com/Download). To get the latest releases every day, install the [Insiders build](https://code.visualstudio.com/insiders).

## Contributing

There are many ways in which you can participate in this project, for example:

* [Submit bugs and feature requests](https://github.com/microsoft/vsc

常见问题 (5)

故障排除
如何修复 VS Code 源代码管理图无法展开提交并显示 "The 'path' argument must be of type string. Received undefined" 错误的问题?

这是 VS Code 1.108 中的一个 bug,会影响包含重命名文件的提交——Git diff 的重命名检测会破坏 Source Control Graph 的渲染,并导致 "Copy Commit Hash" 失效。有两种修复方式:

**临时解决方法(立即生效):** 在你的 settings.json 中设置 "git.similarityThreshold": 100(Ctrl+Shift+P → "Preferences: Open User Settings (JSON)")。这会禁用重命名检测,使 graph 和 diff 编辑器恢复正常渲染。缺点:重命名的文件将显示为分开的删除/添加文件对,而不是重命名。

**永久修复:** 该 bug 已在 VS Code Insiders 版本中修复,并包含在第一个 1.108.x recovery 版本中。待 recovery 版本发布后更新 VS Code,然后移除 git.similarityThreshold 这一临时设置。

注意:相关的 Ctrl+Shift+G 快捷键失效问题在 issue #286669 中单独跟踪。

来源 Issue #286776
故障排除
为什么将鼠标悬停在标签页上时,VS Code 的标签页宽度会抖动或发生变化?

这是 VS Code Insiders 1.142.0 中的一个回归问题(由 PR #340635 引入)。当 workbench.editor.tabSizing 设置为 "fixed" 或 "shrink",且 workbench.editor.tabActionReserveSpace 为 false 时会出现此问题——将鼠标悬停在未修改、未固定的标签页上会使其宽度发生变化,导致标签栏不稳定。该 Bug 已由 PR #341337 修复,因此请将 VS Code Insiders 更新到最新版本。作为临时解决方法,可在 settings.json 中设置 "workbench.editor.tabActionReserveSpace": true,或使用 "workbench.editor.tabSizing": "fit"。

来源 Issue #340854
故障排除
如何修复在VS Code 1.121.0更新后,Windows Server 2022上Remote-SSH服务器安装失败的问题?

这是VS Code 1.121.0版本中的一个已知问题。解决方法:降级至VS Code 1.120.0,或手动删除Windows Server主机上的远程服务器文件夹(例如~/.vscode-server或%USERPROFILE%\\.vscode-server),然后重新连接以触发全新安装。请关注官方问题#318239以获取永久修复。

来源 Issue #318239
故障排除
如何在macOS上修复VS Code 1.123.0 Remote-SSH连接错误'connect EINVAL'?

这是版本1.123.0中的一个已知回归问题。临时解决方案:降级到1.122.0,使用Insiders构建版本,或清理远程服务器的.vscode-server文件夹并重新连接。关注问题#319752以获取永久修复。

来源 Issue #319752
故障排除
如何修复在 VS Code Copilot Chat 中 MCP sampling/createMessage 请求未弹出权限提示就被取消的问题?

在 VS Code 1.141.0 中,Copilot Harness/Agent Host 可能会无条件拒绝 MCP sampling/createMessage 请求,而不是显示采样同意对话框。作为解决方法,打开设置 (JSON) 并设置:"chat.defaultToCopilotHarness": false、"chat.editor.preferCopilotHarness": false 和 "chat.editor.localAgent.enabled": false。保存文件,重新加载 VS Code,然后再次运行 MCP 工具场景。之后应会出现采样权限提示,并且已批准的采样请求应能正常执行。报告者使用 WinDbg MCP 服务器验证了这一组合;尚未单独确定具体是哪一个设置起决定性作用。独立的 Copilot CLI 不受影响。永久修复需要 Agent Host 更新,使其支持 MCP 采样请求,而不是自动拒绝它们。

来源 Issue #340796