vscode官方Blog 07月16日 16:20
May 2025 (version 1.101)
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

Visual Studio Code在2025年5月的更新中带来了多项改进,涵盖了MCP、聊天、源代码控制、编辑器体验等多个方面。新版本增强了对MCP的支持,包括提示、资源和采样,并改进了聊天界面的用户体验,引入了工具集和自定义聊天模式。此外,更新还优化了编辑器的性能,并新增了代码编辑方面的功能,如NES导入建议,以及对无障碍功能的进一步完善。

✨ **MCP 功能增强:** VS Code 增加了对MCP(Model Context Protocol)的支持,包括提示、资源和采样功能。prompts可以生成可重用的代码片段或任务,资源则可以被保存和共享。采样功能允许MCP服务器向模型发出请求。

💬 **聊天功能改进:** 引入了工具集的概念,将相关工具组合在一起,方便管理和使用。用户可以创建自定义聊天模式,定制聊天行为和可用工具。改进了用户消息的显示方式,并优化了撤销操作的可见性。

🔍 **编辑器体验优化:** 改进了编辑文件的效率,并简化了在聊天中添加当前文件作为上下文的方式。新增了“查找时键入”功能,提供了对菜单风格的自定义选项,以及对应用程序图标右键菜单的原生支持。

🛠️ **代码编辑与无障碍功能:** NES(Next Edit Suggestions)导入建议功能增强了对TypeScript、JavaScript和Python文件的支持。新增了用户操作提示音,为代码操作引入了不同的声音,并改进了Agent模式的无障碍功能。

May 2025 (version 1.101)

Release date: June 12, 2025

Security update: The following extension has security updates: ms-python.python.

Update 1.101.1: The update addresses these issues.

Update 1.101.2: The update addresses these issues.

Downloads: Windows: x64 Arm64 | Mac: Universal Intel silicon | Linux: deb rpm tarball Arm snap


Welcome to the May 2025 release of Visual Studio Code. There are many updates in this version that we hope you'll like, some of the key highlights include:

    MCP

      Expand your agent coding flow with support for prompts, resources, and sampling (Show more).Access MCP servers that require authentication (Show more).Debug MCP servers with development mode (Show more).Publish MCP servers from an extension (Show more).

    Chat

      Group and manage related tools by combining them in a tool set (Show more).

    Source Control

      View files in Source Control Graph view (Show more).Assign and track work for GitHub Copilot Coding Agent from within VS Code (Show more).

If you'd like to read these release notes online, go to Updates on code.visualstudio.com.Insiders: Want to try new features as soon as possible? You can download the nightly Insiders build and try the latest updates as soon as they are available.

Chat

VS Code now enables you to define tool sets, either through a proposed API or through the UI. A tool set is a collection of different tools that can be used just like individual tools. Tool sets make it easier to group related tools together, and quickly enable or disable them in agent mode. For instance, the tool set below is for managing GitHub notifications (using the GitHub MCP server).

{  "gh-news": {    "tools": ["list_notifications", "dismiss_notification", "get_notification_details"],    "description": "Manage GH notification",    "icon": "github-project"  }}

To create a tool set, run the Configure Tool Sets > Create new tool sets file command from the Command Palette. You can then select the tools you want to include in the tool set, and provide a description and icon.

To use a tool set in a chat query, reference it by #-mentioning its name, like #gh-news. You can also choose it from the tool picker in the chat input box.

Learn more about tool sets in our documentation.

MCP support for prompts

VS Code's Model Context Protocol support now includes prompt support. Prompts can be defined by MCP servers to generate reusable snippets or tasks for the language model. Prompts are accessible as slash / commands in chat, in the format /mcp.servername.promptname. You can enter plain text or include command output in prompt variables, and we also support completions when servers provide it.

The following example shows how we generate a prompt using AI, save it using the Gistpad MCP server, and then use it to generate a changelog entry:

MCP support for resources

VS Code's Model Context Protocol support now includes resource support, which includes support for resource templates. It is available in several places:

    Resources returned from MCP tool calls are available to the model and can be saved in chat, either via a Save button or by dragging the resource onto the Explorer view.Resources can be attached as context via the Add Context... button in chat, then selecting MCP Resources....You can browse and view resources across servers using the MCP: Browse Resources command or for a server by its entry in the MCP: List Servers command.

Here's an example of attaching resources from the Gistpad MCP server to chat:

MCP support for sampling (Experimental)

VS Code's Model Context Protocol support now includes sampling, which allows MCP servers to make requests back to the model. You'll be asked to confirm the first time an MCP server makes a sampling request, and you can configure the models the MCP server has access to as well as see a request log by selecting the server in MCP: List Servers.

Sampling support is still preliminary and we plan to expand and improve it in future iterations.

MCP support for auth

VS Code now supports MCP servers that require authentication, allowing you to interact with an MCP server that operates on behalf of your user account for that service.

This feature implements the MCP authorization specification for clients, and supports both:

    2025-3-26 spec, where the MCP server behaves as an authorization server.Draft spec, where the MCP server behaves as a resource server (this is expected to be finalized any day now).

If the MCP server implements the draft spec and leverages GitHub or Entra as the auth server, you can manage which MCP servers have access to yohttps://code.visualstudio.com/assets/updates/1_101/manage-trusted-mcp.png/1_101/manage-trusted-mcp.png" alt='Screenshot of the "Manage Trusted MCP Servers" optihttps://code.visualstudio.com/assets/updates/1_101/manage-trusted-mcp-quick-pick.pngc="/assets/updates/1_101/manage-trusted-mcp-quick-pick.png" alt='Screenshot of the "Manage Trusted MCP Servers" Quick Pick.' loading="lazy">

You can also manage which account thahttps://code.visualstudio.comhttps://code.visualstudio.com/assets/updates/1_101/account-pref-quick-pick.pngrevious quick pick):

For other MCP servers that rely on dynamic client regihttps://code.visualstudio.comhttps://code.visualstudio.com/assets/updates/1_101/linear-account-menu.pngme place as everything else, for example with Linear:

There you can also sign out. For these we support not only the code authorization flow but also the device code flow should your authorization server support it.

We have also introduced the command Authentication: Remove Dynamic Authentication Providers that allows you to clean up any of these dynamic client registrations. This will throw away the client id issued to VS Code and all data associated with this authentication provider.

Remember, you can use the MCP: Add Server... command to add MCP servers. This is the same entry point for servers with authentication.

MCP development mode

You can enable development mode for MCP servers by adding a dev key to the server config. This is an object with two properties:

    watch: A file glob pattern to watch for files change that will restart the MCP server.debug: Enables you to set up a debugger with the MCP server. Currently, we only support debugging Node.js and Python servers launched with node and python respectively.

.vscode/mcp.json

{  "servers": {    "gistpad": {      "command": "node",      "args": ["build/index.js"],+     "dev": {+       "watch": "build/**/*.js",+       "debug": { "type": "node" }+     },

Chat UX improvements

We're continuously working to improve the chat user experience in VS Code based on your feedback. One such feedback was that it can be difficult to distinguish between user messages and AI responses in the chat. To address this, we've made the appearance of user messages more distinct.

Undoing previous requests is now also more visible - just hover over a request and select the X button to undo that request and any following requests. Or even quicker, use the ⌘Backspace (Windows, Linux Delete) keyboard shortcut!

Finally, attachments from the chat input box are now more navigable.

Learn more about using chat in VS Code in our documentation.

Apply edits more efficiently

When editing files, VS Code can take two different approaches: it either rewrites the file top to bottom or it makes multiple, smaller edits. Both approaches differ, for example the former can be slower for large files and intermediate states do often not compile successfully. Because of that the UI adopts and conditionally disables auto-save and squiggles, but only when needed.

We have also aligned the keybindings for the Keep and Undo commands. Keeping and undoing individual changes is now done with ⌘Y (Windows, Linux Ctrl+Y) and ⌘N (Windows, Linux Ctrl+N). In the same spirit, we have also aligned the keybinding for keeping and undoing all changes in a file, they are now ⇧⌘Y (Windows, Linux Ctrl+Shift+Y) and ⇧⌘N (Windows, Linux Ctrl+Shift+N). This is not just for alignment but also removes prior conflicts with popular editing commands (like Delete All Left).

Implicit context

We've streamlined and simplified the way that adding your current file as context works in chat. Many people found the "eyeball toggle" that we previously had to be a bit clunky. Now, your current file is offered as a suggested context item. Just select the item to add or remove it from chat context. From prompt input field, press Shift+Tab, Enter to quickly do this with the keyboard.

Additionally, in agent mode, we include a hint about your current editor. This doesn't include the contents of the file, just the file name and cursor position. The agent can then use the tools it has to read the contents of the file on its own, if it thinks that it's relevant to your query.

Learn more about adding context in chat in our documentation.

Fix task configuration errors

Configuring tasks and problem matchers can be tricky. Use the Fix with Github Copilot action that is offered when there are errors in your task configuration to address them quickly and efficiently.

Custom chat modes (Preview)

By default, the chat view supports three built-in chat modes: Ask, Edit and Agent. Each chat mode comes with a set of base instructions that describe how the LLM should handle a request, as well as the list of tools that can be used for that.

You can now define your own custom chat modes, which can be used in the Chat view. Custom chat modes allow you to tailor the behavior of chat and specify which tools are available in that mode. This is particularly useful for specialized workflows or when you want to provide specific instructions to the LLM. For example, you can create a custom chat mode for planning new features, which only has read-only access to your codebase.

To define and use a custom chat mode, follow these steps:

    Define a custom mode by using the Chat: Configure Chat Modes command from the Command Palette.Provide the instructions and available tools for your custom chat mode in the *.chatprompt.md file that is creahttps://code.visualstudio.comhttps://code.visualstudio.com/assets/updates/1_101/custom-chat-mode-view.png mode from the chat mode dropdown list.Submit your chat prompt.

The following example shows a custom "Planning" chat mode:

---description: Generate an implementation plan for new features or refactoring existing code.tools: ['codebase', 'fetch', 'findTestFiles', 'githubRepo', 'search', 'usages']---# Planning mode instructionsYou are in planning mode. Your task is to generate an implementation plan for a new feature or for refactoring existing code.Don't make any code edits, just generate a plan.The plan consists of a Markdown document that describes the implementation plan, including the following sections:* Overview: A brief description of the feature or refactoring task.* Requirements: A list of requirements for the feature or refactoring task.* Implementation Steps: A detailed list of steps to implement the feature or refactoring task.* Testing: A list of tests that need to be implemented to verify the feature or refactoring task.

Note: The feature is work in progress, but please try it out! Please follow the latest progress in VS Code Insiders and let us know what's not working or is missing.

Task diagnostic awareness

When the chat agent runs a task, it is now aware of any errors or warnings identified by problem matchers. This diagnostic context allows the chat agent to respond more intelligently to issues as they arise.

Terminal cwd context

When agent mode has opened a terminal and shell integration is active, the chat agent is aware of the current working directory (cwd). This enables more accurate and context-aware command support.

Floating window improvements

When you move a chat session into a floating window, there are now two new actions available ihttps://code.visualstudio.comhttps://code.visualstudio.com/assets/updates/1_101/chat-floating.pngchat back into the VS Code window where it came fromStart a new chat session in the floating window.

It's now possible to enable or disable all built-in tools in agent mode or your custom mode. For example, disable editFiles to disallow agent mode to ehttps://code.visualstudio.comhttps://code.visualstudio.com/assets/updates/1_101/built-in-toolsets.pngode> for running terminal commands.

In agent mode, select the Configure Tools button to open the tool picker, and select your desired set of tools.

Some of the entries in this menu represent tool sets that group multiple tools. For example, we give the model multiple tools to edit or create text files and notebooks, which may also differ by model family, and editFiles groups all of these.

Send elements to chat (Experimental)

Last milestone, we added https://code.visualstudio.comhttps://code.visualstudio.com/assets/updates/1_101/live-preview-select-web-elements.pngelect-and-attach-ui-elements-to-chat-experimental">new experimental feature where you could open the Simple Browser and select web elements to add to chat from the embedded browser.

As we continue to improve this feature, we have added support for selecting web elements in the Live Preview extension as well. Check this out by downloading the extension and spinning up a live server from any HTML file.

Accessibility

User action required sound

We’ve added an accessibility signal to indicate when chat requires user action. This is opt-in as we fine tune the sound. You can configure this behavior with accessibility.signals.chatUserActionRequired.

New code action sounds

We’ve introduced distinct sounds for:

Agent mode accessibility improvements

We now include rich information about confirmation dialogs in the accessible view, covering past tool runs, the current tool run, and any pending confirmations. This includes the inputs that will be used.

When a confirmation dialog appears in a response, the action’s title is now included in the ARIA label of the corresponding code block, the response’s ARIA label, and the live alert to provide better context for screen reader users.

Editor Experience

Find as you type

Setting: editor.find.findOnType

Find-as-you-type has been the default behavior of the Find control, but now you can control whether to keep it that way or disable it so that it will only perform the search after hitting enter.

Setting: window.menuStyle

You can now specify the menu style that is used for the menu bar and context menus on Windows and Linux, and for context menus on macOS by using the window.menuStyle setting:

Source control history item details

Upon popular demand, selecting an item in the Source Control Graph view now reveals the resources of that history item. You can choose between a tree view or list view representation from the ... menu.

To open all resources of a history item in the multi-file diff editor, use the Open Changes action on hover. Selecting a particular resource from the Graph view opens a diff editor only for that resource. Select the

Add history item to chat context

You can now add a source control history item as context to a chat request. This can be useful when you want to provide the contents of a specific commit or pull request as context for your chat prompt.

To add a history item to chat, use Add Context > Source Control from the Chat view and then choose a particular history item. Alternatively, right-click the history item in the source control graph and then select Copilot > Add History Item to Chat from the context menu.

Instance policy

Task runOptions now has an instancePolicy property, which determines what happens when a task has reached its instanceLimit.

Options include prompt (default), silent, terminateNewest, terminateOldest, and warn.

Terminal

Language server based terminal suggest

Language server completions are now available in the terminal for interactive Python REPL sessions.This brings the same language completions you receive in the editor now inside the terminal.We are starting with support for Python via Pylance, with plans to expand to more languages in the future.

To try it out, ensure the following settings are enabled:

Remote Development

The Remote Development extensions, allow you to use a Dev Container, remote machine via SSH or Remote Tunnels, or the Windows Subsystem for Linux (WSL) as a full-featured development environment.

Highlights include:

    SSH pre-connection scriptRemote Explorer improvements

You can learn more about these features in the Remote Development release notes.

Contributions to extensions

Python

The Python Extension now includes the following chat tools: “Get information for a Python Environment”, “Get executable information for a Python Environment”, “Install Python Package” and “Configure Python Environment”. You can either directly reference them in your prompt by adding #getPythonEnvironmentInfo #installPythonPackage, or agent mode will automatically call the tool as applicable. These tools seamlessly detect appropriate environment information, based on file or workspace context, and handle package installation with accurate environment resolution.

The “Configure Python Environment” tool ensures that the Python Environment is set up correctly for the workspace. This includes creating a Virtual Environment if needed, and selecting that as the active Python Environment for the workspace.

Tools that were previously introduced in the Python Environments extension (preview) have been migrated to the Python extension, thereby making these tools available to all users with the Python extension installed.

Create a project from a template

The Python Environments extension now supports project creation for Python packages and basic scripts, allowing you to bypass scaffolding and get coding more quickly. Use the command Python Envs: Create Project from Template to select whether you want to create a package or a script.

For package creation, you are able to name the package, create a virtual environment, and receive a scaffolded project which includes a tests subfolder, pyproject.toml, dev-requirements.txt, and boilerplate __main__.py and __init__.py files.

For scripts, it creates a new python file with the name of your choice and include boilerplate code.

PyEnv and Poetry support

We added support for pyenv for environment management, and poetry for both package and environment management in the Python Environments extension.

GitHub Pull Requests

There has been more progress on the GitHub Pull Requests extension, which enables you to work on, create, and manage pull requests and issues. New features include:

    Images in comments from private repositories are now shown in pull request file comments.The "Notifications" view is now shown by default, collapsed.-- Issue and pull request links in the timeline an in the issue/pull request body are now opened in VS Code, rather than going to the browser.The "Assigned to Me" query in the "Pull Requests" view has been removed, and the "Local Pull Request Branches" and "All Open" queries can be removed using the setting githubPullRequests.queries. For repositories with Copilot, a "Copilot on My Behalf" query is added when the setting is unconfigured.Copilot "start working", "stop working", and "View Session" are now shown in the timeline.

Review the changelog for the 0.112.0 release of the extension to learn about the other highlights.

Extension Authoring

MCP extension APIs

Extensions can now publish collections of MCP servers. This enables you to bundle MCP servers with your extension or build extensions that dynamically discover MCP servers from other sources. Learn more in our MCP extension development guide or by checking out the MCP extension sample.

Secret scanning when packaging extensions

VSCE now scans for secrets when packaging your extension. If any potential secrets (for example, API keys, tokens, credentials, or environment variable files like .env) are detected in your source files, VSCE displays an error during the packaging process. This helps you avoid accidentally publishing sensitive information to the Marketplace. Make sure to review and address any error before publishing your extension.

If you need to bypass specific checks, you can use the --allow-package-secrets <secret_type> or --allow-package-env-file flags when running VSCE. These flags let you configure which secret or environment file checks should be skipped during packaging.

Web environment detection

⚠️ Breaking change ⚠️

Setting: extensions.supportNodeGlobalNavigator

The Node.js extension host is now updated to v22 from v20, as part of our Electron 35 runtime update. This update brings in support for the navigator global object in the desktop and remote extension hosts.

This change could introduce a breaking change for extensions that rely on the presence of the navigator object to detect the web environment.

To help extension authors migrate, we have created a polyfill for globalThis.navigator that is initialized to undefined, so your extension continues to work correctly. The polyfill is behind the extensions.supportNodeGlobalNavigator VS Code setting. By default, this setting is disabled and the polyfill is in place. We capture telemetry and log an error (in extension development mode) when your extension tries to access the navigator in this way.

In the future, this setting might be enabled by default, so we urge extension authors to migrate their code to be compatible with the new navigator global object. Follow these steps to migrate your code:

    Check the extension host log for a PendingMigrationError that has error stack originating your extension.Ensure checks like typeof navigator === 'object' are migrated to typeof process === 'object' && process.versions.node as needed.Enable extensions.supportNodeGlobalNavigator.Verify extension behavior remains unchanged.

Proposed APIs

Authentication Providers: Supported Authorization Servers for MCP

Currently only leveraged in MCP authentication, this API proposal enables your AuthenticationProvider to declare the authorization servers that are associated with it.

For example, if you look at the GitHub Authentication Provider, it includes the typical GitHub authorization URL in the authorizationServerGlobs property of the auth provider contribution:

{  "label": "GitHub",  "id": "github",  "authorizationServerGlobs": ["https://github.com/login/oauth"]}

This property is used for activation of your extension - if the requested authorization server matches, your extension will be activated.

Additionally, when registering the authentication provider, you MUST include the finalized authorization server URL globs. Just like what GitHub Authentication does here:

vscode.authentication.registerAuthenticationProvider(  type,  this._githubServer.friendlyName,  this,  {    supportsMultipleAccounts: true,    supportedAuthorizationServers: [      ghesUri ?? vscode.Uri.parse('https://github.com/login/oauth')    ]  });

For a more complex example, look to Microsoft Authentication. The authorization server depends on the tenant being placed in the path. So for this, we use a wildcard in the contribution:

{  "label": "Microsoft",  "id": "microsoft",  "authorizationServerGlobs": [    "https://login.microsoftonline.com/*/v2.0"  ]},

and in the registration:

authentication.registerAuthenticationProvider('microsoft', 'Microsoft', authProvider, {  supportsMultipleAccounts: true,  supportedAuthorizationServers: [Uri.parse('https://login.microsoftonline.com/*/v2.0')]});

Then, when a caller passes in an authorization server URL when it asks for auth, it is passed down to both the getSessions and createSession functions via the AuthenticationProviderSessionOptions that are already present.

As mentioned, this functionality is currently used in MCP support, where we receive the authorization server URL to authenticate with from the MCP server. That URL is then mapped to an auth provider, or if none exists, an auth provider is dynamically created for that auth server.

The full API proposal can be found in the vscode repo and we'd love to hear your feedback in the GitHub issue!

Engineering

Electron 35 update

In this milestone, we are promoting the Electron 35 update to users on our Stable release. This update comes with Chromium 134.0.6998.205 and Node.js 22.15.1. We want to thank everyone who self-hosted on Insiders builds and provided early feedback.

Adopting ESM in a real-world extension

Last milestone, we have announced support for JavaScript-modules (ESM). This enables extensions to use import and export statements, but currently only when targeting the NodeJS extension host.

This month, we have done a real-world adoption with GitHub Issue Notebooks. It is not trivial because this extension can be run in the NodeJS extension host (which supports ESM extensions) and the web worker extension host, which currently does not support ESM extensions. This required a more complex bundler configuration and you might want to take inspiration from its esbuild-config.

Notable fixes

    250077 - Tree-Sitter based syntax highlighting depends on the model service

Thank you

Last but certainly not least, a big Thank You to the contributors of VS Code.

Issue tracking

Contributions to our issue tracking:

Pull requests

Contributions to vscode:

Contributions to vscode-copilot-release:

Contributions to vscode-css-languageservice:

Contributions to vscode-custom-data:

Contributions to vscode-eslint:

Contributions to vscode-generator-code:

Contributions to vscode-js-debug:

Contributions to vscode-jupyter:

    @WillHirsch: Downgrade diagnostic severity for use of bang instead of percent for package installs PR #16601

Contributions to vscode-languageserver-node:

Contributions to vscode-markdown-tm-grammar:

Contributions to vscode-prompt-tsx:

Contributions to vscode-pull-request-github:

Contributions to vscode-python-debugger:

Contributions to debug-adapter-protocol:

Contributions to language-server-protocol:

Contributions to lsprotocol:

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

VS Code 更新 MCP 聊天 编辑器
相关文章