vs-code

Subscribe to all “vs-code” posts via RSS or follow GitHub Changelog on Twitter to stay updated on everything we ship.

~ cd github-changelog
~/github-changelog|main git log main
showing all changes successfully

GitHub Copilot Chat in VS Code, Visual Studio, and GitHub.com now supports web search, enabling you to easily chat about recent events, new developments, trends, and technologies. This feature is already available for Copilot Business and Copilot Enterprise.

To get started, first enable the “Copilot Access to Bing” policy in your Copilot Settings.

Then try it out with Copilot Chat by asking a question that would benefit from web search. Here are some examples:

  • What's the latest release of node.js
  • What are some recent articles about SAT tokens securing against vulnerabilities in Node?

For more information, check out our documentation and join the discussion within the GitHub Community!

See more

With GitHub Copilot code review in Visual Studio Code, you can now get fast, AI-powered feedback on your code as you write it, or request a review of all your changes before you push.

There are two ways to use Copilot code review in VS Code:

  • Review selection: highlight code in VS Code and ask for an initial review. (Available now to all Copilot subscribers)
  • Review changes: ask Copilot for a deeper review of all your changes before you push from the “Source Control” tab, which you can also do in your pull request on GitHub.com. (Join the waitlist, open to all Copilot subscribers)

Copilot’s feedback shows up as comments in the editor, attached to lines of your code. Where possible, the comments include actionable code suggestions, which you can apply in one click.

A comment from Copilot in Visual Studio Code

To learn more about Copilot code review, head to the docs.

See more

A list of the GitHub Copilot Chat updates in the October VS Code release.

In the latest Visual Studio Code release, you will find a suite of enhancements to GitHub Copilot Chat, designed to streamline your coding, debugging, and testing processes. These features are now available for you to try out in the latest version of Visual Studio Code.

Start a code editing session with multi-file editing (Preview)

Setting: github.copilot.chat.edits.enabled

With multi-file editing, currently in preview, you can start an AI-powered code editing session where you can quickly iterate on code changes. Use multi-file editing to prompt GitHub Copilot to propose code changes across multiple files in your workspace. These edits are applied directly in the editor, so you can quickly review them in place, with the full context of the surrounding code.

Multi-file editing is great for iterating on large changes across multiple files. It brings the conversational flow of Copilot Chat and fast feedback from inline chat together in one experience. You can have an ongoing, multi-turn chat conversation on the side, while benefiting from inline code suggestions.

Get started with multi-file editing with these steps:

  1. Start an edit session by selecting Open Copilot Edits from the Chat menu.

Screenshot showing the Copilot menu in the Command Center, highlighting the Open Edit Session item

  1. Add relevant files to the working set to indicate to GitHub Copilot which files you want to work on.
  2. Enter a prompt to tell GitHub Copilot about the edit you want to make! For example, Add a simple navigation bar to all pages or Use vitest instead of jest.

Get more details about multi-file editing in the VS Code documentation. Try it out now and provide your feedback through our issues!

A new place to chat: Secondary Side Bar

The new default location for GitHub Copilot Chat view is the Secondary Side Bar. By using the Secondary Side Bar, you can have chat open at any time, while you still have other views available to you like the File Explorer or Source Control. This provides a more integrated AI experience in VS Code. You can quickly get to chat by using the Chat menu in the Command Center.

Chat view in its new location after having moved

With the introduction of the new Chat menu next to the Command Center, bringing up the Secondary Side Bar with chat is just a click away:

The Chat menu gives you access to the most common tasks for Copilot Chat. We provided a new setting, chat.commandCenter.enabled, that you can use to hide this menu if you wish.

Chat Menu

Note: If you had previously installed GitHub Copilot, a view will show up at the location you had Copilot Chat before that enables you to restore the Chat view to the old location.

Chat view in its old location after having moved

Code review (Preview)

With Copilot-powered code review in Visual Studio Code, you can now get fast, AI-powered feedback on your code as you write it, or request a review of all your changes before you push. Code review in Visual Studio Code is currently in preview. Try it out and provide feedback through our issues.

There are two ways to use code review in VS Code:

  • Review selection: For a quick review pass, select code in the editor and either select Copilot > Review and Comment from the editor context menu, or use the GitHub Copilot: Review and Comment command from the Command Palette. (This feature is in preview.)
  • Review changes: For a deeper review of all uncommitted changes, select the Copilot Code Review button in the Source Control view, which you can also do in your pull request on GitHub. (Join the waitlist, open to all Copilot subscribers)

Request review of uncommitted changes

Copilot’s feedback shows up as comments in the editor, attached to lines of your code. Where possible, the comments include actionable code suggestions, which you can apply.

Screenshot showing a comment reviewing a code selection

Head to the code review documentation to learn more.

GitHub Copilot’s quick review on code selection can provide feedback that matches the specific practices of your team or project, provided you give it the right context. When reviewing selections with custom review instructions, you can define those specific requirements via the github.copilot.chat.reviewSelection.instructions setting. Similar to code-generation and test-generation instructions, you can either define the instructions directly in the setting, or you can store them in a separate file and reference it in the setting.

The following code snippet shows an example of review instructions:

"github.copilot.chat.reviewSelection.instructions": [
{
"text": "Logging should be done with the Log4j ."
},
{
"text": "Always use the Polly library for fault-handling."
},
{
"file": "code-style.md" // import instructions from file `code-style.md`
}
],

Here is an example of the contents of the code-style.md file:

Private fields should start with an underscore.

A file can only contain one class declaration.

Sort by relevance in semantic search (Experimental)

Setting: github.copilot.chat.search.semanticTextResults

Last milestone, we introduced the ability to perform a semantic search using GitHub Copilot to get search results that are semantically relevant to your query. We have now improved the search results by sorting them by their relevance. Keyword matches from more relevant snippets are deemed more relevant overall.

File-based custom instructions enabled by default (Preview)

Setting: github.copilot.chat.codeGeneration.useInstructionFiles

The newly introduced .github/copilot-instructions.md file lets you document code-specific conventions for GitHub Copilot in your workspace or repository. With this release, the setting is enabled by default in VS Code, so chat conversations automatically include this file if it is present in the workspace. You can verify which instructions are added to a chat request in the Used references list. Learn more about customizing Copilot with instructions.

Intent detection in Copilot Chat

Setting: chat.experimental.detectParticipant.enabled

GitHub Copilot has several built-in chat participants, such as @workspace, which also contribute commands to the Chat view. Previously, you had to explicitly specify the chat participant and command in a chat prompt. To make it easier to use chat participants with natural language, we’ve enabled Copilot Chat to automatically route your question to a suitable participant or chat command.

Screenshot of Chat view that shows how the '@workspace' participant is automatically detected.

If the automatically selected participant is not appropriate for your question, you can select the rerun without link at the top of the chat response to resend your question to GitHub Copilot.

Control current editor context

Copilot Chat has always automatically included your current selection or the currently visible code as context with your chat request. Large Language Models (LLMs) are generally good at understanding whether a piece of context is relevant. But sometimes, when you ask a question that is not about your current editor, including this context might affect how the model interprets your question.

We now show a special attachment control in the chat input that gives a hint about the editor context. It also enables you to toggle whether or not to include the editor context.

The current editor context control in the chat input, which shows that the context is not included.

There are no changes to the behavior of the editor context. When the active editor has a selection, then just the selection is included. Otherwise, just the code that is scrolled into view is included. You can still attach other files or the full file by using the paperclip button or by typing # in the chat prompt.

A common use case of Copilot Chat is asking questions about the code in your workspace, such as using /tests to generate new unit tests for the selected code or asking @workspace to find some specific class or function in your project. This milestone, we added enhanced links for any workspace symbols that GitHub Copilot mentions in chat responses. These symbol links can help you better understand Copilot responses and learn more about the symbols used in them.

Symbol links are rendered as little pills in the response, just like the file links we added last milestone. To learn more about a symbol, select the symbol link to jump to that symbol’s definition:

You can also hover over the symbol link to see which file the symbol is defined in:

Hovering over a symbol link to see the file it's defined in

To start exploring a symbol in more detail, right-click on the symbol link to bring up a context menu with options, such as Go to Implementations or Go to References:

Using the context menu on a symbol link to learn more about a symbol

Basic symbol links should work for any language that supports Go to Definition. More advanced IntelliSense options, such as Go to Implementations, also require support for that language. Make sure to install language extensions to get the best symbol support for any programming languages used in GitHub Copilot responses.

Workspace indexing

@workspace lets you ask questions about code in your current project. This is implemented using either GitHub’s code search or a smart local index that VS Code constructs. This milestone, we added a few more UI elements that let you understand how this workspace index is being used.

First up, the new GitHub Copilot: Build Local Workspace index command lets you explicitly start indexing the current workspace. Normally, this indexing is automatically kicked off the first time you ask a @workspace question. With the new command, you can start indexing at any time. The command also enables indexing larger workspaces, currently up to 2000 files (not including ignored files, such as the node_modules or out directories).

While the index is being built, we now show a progress item in the status bar:

A status bar item showing the progress of indexing the current workspace

Indexing workspaces with many hundreds of files can take a little time. If you try to ask an @workspace question while indexing is being constructed, instead of waiting, GitHub Copilot will try to respond quickly by using a simpler local index that doesn’t take as long to build. We now show a warning in the response when this happens:

A warning showing on a response telling the user the Copilot user

Notice that Copilot was still able to answer the question in this case, even though it used the simpler local index. That’s often the case, although more ambiguous or complex questions might only be answerable once the more complex index has been constructed. Also keep in mind that if your workspace is backed by a GitHub repository, we can instead use GitHub’s code search to answer questions. In this case, GitHub Copilot uses code search instead of the simpler local index.

Fix using Copilot action in the Problem hover

The Problem hover now includes the action to fix the problem using GitHub Copilot. You can use this action with problems that have a fix available, and the fix is generated by Copilot.

The Problem hover showing a fix using Copilot action

Chat settings updates

As we continue to add new features to GitHub Copilot, we want to make it easier to check out what’s new and ready to try out. We’ve restructured our settings and added support for tagging preview and experimental settings.

New features may go through the following early access stages, which are described in the settings editor as follows:

Experimental: This setting controls a new feature that is actively being developed and may be unstable. It is subject to change or removal.

Preview: This setting controls a new feature that is still under refinement but is ready to use. Feedback is welcome.

You can check out all of GitHub Copilot’s preview features using @tag:preview in the Settings editor and all of the experimental features using @tag:experimental.

Discuss this and more in our dedicated community discussion.

See more

New skills have been added to Copilot Chat in VS Code, enabling you to search across GitHub to find commits, issues, pull requests, repositories, and topics. GitHub Copilot will either automatically infer when to use the @github agent, or you can invoke it directly by asking questions like:
@github What are all of the open PRs assigned to me?
@github What are the latest issues assigned to me?
@github When was the latest release?
@github Show me the recent merged pr's from @dancing-mona

This functionality is available to all Copilot users, with Copilot Chat v0.20.3 or later and VS Code or VS Code Insiders 1.93 or later. Learn more about asking questions in Copilot Chat on VS Code and available skills

Let us know your feedback and join the discussion within the GitHub Community!

See more

A list of the GitHub Copilot Chat updates in the September VS Code release.

In the latest Visual Studio Code release, you will find a suite of enhancements to GitHub Copilot Chat, designed to streamline your coding, debugging, and testing processes.

These features are now available for you to try out in the latest version of Visual Studio Code.

Pick your language model

Sign up for early access to the latest OpenAI o1 models for more precise and efficient coding assistance. Once you have access, you will have the model picker control in Copilot Chat in VS Code. You can then choose which model version to use for your chat conversations.

Screenshot of the language model picker control in Cpilot Chat.

Enhanced code quality with GPT-4o

Copilot Inline Chat now uses GPT-4o, giving you faster, more accurate, and higher-quality code and explanations when you use Chat in the editor.

Public code matching in chat

You can allow GitHub Copilot to return code that could match publicly available code on GitHub.com. When this functionality is enabled for your organization subscription or personal subscription, Copilot code completions already provided you with details about the matches that were detected. We now show you these matches for public code in Copilot Chat as well.

If this is enabled for your organization or subscription, you might see a message at the end of the response with a View matches link. If you select the link, an editor opens that shows you the details of the matching code references with more details.

Screenshot of GitHub Chat in VS Code. A red rectangle highlights the end of a response that reads "Similar code found with 2 license types - View matches."

File suggestions in chat

In chat input fields, you can now type # to get file name suggestions and quickly attach them to your prompt as context. This works in chat locations that support file attachments, such as the Chat view, Quick Chat, Inline Chat, and Notebook Chat.

Drag and drop files to add chat context

You can now attach additional files as context for a chat prompt by dragging files or editor tabs from the workbench directly into chat. For Inline Chat, hold Shift and drop a file to add it as context instead of opening it in the editor.

File attachments included in history

When you attach a file or editor selection as relevant context to your chat request, Copilot Chat will include them in the history of follow-on requests so that you can keep referring to them without having to reattach them. Previously, this context was added only for the current request and was not included in the history of follow-on requests.

Chat conversation shows that Copilot keeps track of attached files across multiple prompts.

Inline Chat and completions in Python native REPL

The native REPL editor, used by the Python extension, now supports Copilot Inline Chat and code completions directly in the input box.

Semantic search results (Preview)

Setting: github.copilot.chat.search.semanticTextResults

You can perform an exact search across your files with the Search view. It also now uses Copilot to give search results that are semantically relevant.

This functionality is still in preview and by default, the setting is not enabled. Try it out and let us know what you think!

Fix test failure (Preview)

Setting: github.copilot.chat.fixTestFailure.enabled

New fix test logic now helps you diagnose failing unit tests. This logic is triggered in some scenarios by the /fix slash command, and you can also invoke it directly with the /fixTestFailure slash command. The command is enabled in chat by default but can be disabled via the setting github.copilot.chat.fixTestFailure.enabled.

Automated test setup (Experimental)

Setting: github.copilot.chat.experimental.setupTests.enabled

You can now use an experimental /setupTests slash command to configure the testing set up for your workspace. This command can recommend a testing framework, provide steps to set up and configure it, and suggest a VS Code extension to provide testing integration in VS Code.

When you use the /tests command to generate tests for your code, Copilot Chat can recommend /setupTests and testing extensions if it looks like such an integration has not been set up yet in your workspace.

Start debugging from Chat (Experimental)

Setting: github.copilot.chat.experimental.startDebugging.enabled

You can use the /startDebugging slash command to find or create a launch configuration and start debugging your application. When you use @vscode in Copilot Chat, /startDebugging is now available by default.

A user types /startDebugging flask app port 3000 in the panel chat and is provided with the launch configuration.

Chat in Command Center (Experimental)

Setting: chat.commandCenter.enabled

You can now access chat via the Command Center, which provides access to all relevant chat commands, like starting the different chat experiences or attaching context to your prompt. Note that the Command Center itself needs to be enabled for the chat Command Center entry to show.

Chat Command Center button and the drop-down menu with relevant chat actions.

Custom test generation instructions (Experimental)

Generating tests with Copilot helps you write code that is more robust. With custom instructions you can ensure that the generated tests meet your specific coding style and requirements.

Setting: github.copilot.chat.experimental.testGeneration.instructions

In addition, you can now define instructions for test generation in settings or import them from a file. For example, if you always want to use a particular unit testing framework for your tests. Configure the test-generation instructions in the github.copilot.chat.experimental.testGeneration.instructions setting.

✍️ We want your feedback

Try out these new features and share your experiences and feedback in our issues.

See more

VS Code August recent updates

Since last month’s upgrade to GPT-4o, we now increased the available Chat context, so you can reference larger files and have longer chat conversations with GitHub Copilot Chat in VS Code. Additionally, you can now click Attach Context in Inline and Quick Chat to add more relevant context to your queries.

This month’s release also brings the following improvements to Copilot Chat in VS Code:

  • Easily generate tests using the Generate Tests using Copilot action or the /tests slash command. Copilot will now update and append tests to existing files or create a new test file if none exists. Learn more.
  • Revisit previous chat sessions with the Show Chats button. Sessions now have AI-generated names and can be manually renamed. Entries are sorted by the date of the last request and grouped by date buckets. Learn more.

  • Provide specifics on unsatisfactory Chat responses by selecting the Thumbs down button. A dropdown with detailed options helps you pick a problem type or report it as an issue to us, helping us improve Copilot. Learn more.

  • Code Actions now have clearer names: Generate Tests using Copilot and Generate Documentation using Copilot. Just place the cursor on an identifier and choose the action. Learn more.

Experimental New Features

Experimental settings are available in VS Code to gather your feedback and influence the future development of Copilot. Share your thoughts in our issues.

Check out the full release notes for VS Code’s August release (version 1.93) for more details and to learn more about the features in this release.

See more

The CodeQL for Visual Studio Code documentation is now on docs.github.com.

This migrates the content from https://codeql.github.com/docs/codeql-for-visual-studio-code and provides a consistent, single-site experience with improved text, descriptions, images, and navigation.

On May 8, 2024, we’ll begin automatically redirecting from the original codeql.github.com location to the new location.

The source files now exist in Markdown format in the public, open-source docs repository. If you would like to contribute, you can consult and follow the steps listed in the GitHub Docs contributing guide.

See more

Copilot enhancements in Visual Studio Code

We have introduced several features to the Copilot Chat extension in Visual Studio Code. These updates, available in Visual Studio Code 1.86 and the latest Copilot Chat extension 0.12, aim to provide a more streamlined and interactive coding experience. From new context variables that offer more control over the context you provide to Copilot, to expanded voice control capabilities, these updates are designed to improve your interaction with Copilot. Let’s take a closer look at these new features.

Context variables

You can use context variables to provide additional context to your questions in chat by using the # symbol. We have introduced two new context variables: #file and #editor to give you more control to specify that context.

The #file variable lets you reference specific files from your workspace in your chat prompt. This helps make the answers from Copilot Chat more relevant to your code by providing context about the file you are working with. You can ask questions like “Can you suggest improvements to #file:package.json?” or “How do I add an extension in #file:devcontainer.json?”. By using the #file variable, you can get more targeted and accurate responses from Copilot.

image

With the #editor context variable, you have control over whether to include the visible code of the active editor in your prompt to Copilot Chat. Previously, this information was automatically included when you hadn’t selected text in the editor. Now, you can choose to explicitly add the visible code to the context or omit it for more general questions.

image

The #selection context variable already enabled you to focus Copilot’s suggestions on the specific code you select in the editor. By combining the #file, #editor, and #selection variables, you have full control over the context you provide to Copilot Chat, ensuring that you receive the most relevant and helpful answers.

Inline chat

We also added several features, such as Copilot Code Actions and an updated live mode, to make your Copilot inline chat experience more productive.

As you’re writing and iterating over your code, you can now invoke Copilot through Code Actions (light bulb) on a specific line in the editor. This functionality gives you direct and targeted access to Copilot to improve your code. When there is an error in the code, you can use the sparkle Code Action to let Copilot explain the error or propose a fix.

Image

With the updated inline chat live mode, you can now see and evaluate the suggested code modifications in-place in the editor. Additionally, you have the option to drill through to the inline diff editor to compare the proposed changes against the original code.

Responsible AI

We emphasize responsible usage of AI, especially when it comes to source code. We’ve added a new setting that asks users for confirmation before saving code that was generated by Copilot. This ensures that users have control over the code generated by Copilot and can review it before saving.

This setting, inlineChat.acceptedOrDiscardBeforeSave, is enabled by default. When the setting is enabled, a file save will wait for the user to accept or discard any pending inline chat session. This also applies when Auto Save is enabled, which will be temporarily turned off until inline chat has ended.

Image

Enhancing voice interactions

We have further enhanced voice interactions in VS Code by giving you more flexibility and options for initiating voice interactions.

Now, you can use the “Hey Code” voice command to start a voice session with Copilot Chat. You can choose whether you want this voice command to open the Chat view, inline chat in the editor, quick chat, or choose dynamically based on where the focus is.

To enable this voice command, make sure to install the GitHub Copilot Chat and VS Code Speech extensions. Once installed, you can enable the “Hey Code” voice command in the accessibility.voice.keywordActivation setting.

In addition, you can accelerate voice input for chat by using the “hold to speak” mode: press and hold the keybinding for inline chat and voice recording automatically starts. As soon as you release the keys, the request is sent to Copilot.

Besides these main features, you can also explore our other exciting new preview features.

See more

The GitHub Actions extension for VS Code is now in public beta. This extension includes rich editing features, such as syntax validation and autocomplete, making workflow authoring and editing faster and easier. Developers will also be able to view workflow runs, inspect logs, and trigger re-runs directly from VS Code.

To get started, visit the VS Code Marketplace or learn more about the extension's capabilities from the Actions VS Code Extension blog post.

See what's next for Actions by visiting our public roadmap.

See more

You can now enable Visual Studio Code as a preferred editor for all Assignments in GitHub Classroom. To do so, select “Visual Studio Code” as a supported editor during Assignment creation. Once enabled, all accepted Assignments will include an “Open in VS Code” badge in the Assignment repository READMEs. This badge will open the assignment in Visual Studio Code with the new GitHub Classroom extension auto-installed. You can also independently install the extension from the Visual Code Marketplace

Get started with the Visual Studio Code integration

Add a Supported Editor section of Assignment Creation now shows Visual Studio Code as a dropdown option

See more