⚡ Code faster and better - Slash Commands and Context Variables now available in Copilot via Visual Studio #102847
Akash1134
announced in
Copilot News and Announcements
Replies: 1 comment 9 replies
-
|
Akash, does the # command for files work in VS Code as well (or is it on the list)? Thanks. |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We have introduced two new powerful features to the latest Visual Studio Copilot Chat extension: slash commands (/) that allow you to direct Copilot to perform specific tasks, and context Variables (#) that allow you to specify a file for Copilot to focus its answer on. These features are available on the latest Chat extension that is compatible with Visual Studio 2022 version 17.8 and higher.
Slash Commands 🤖
Slash commands are special commands that you can use in chat to receive targeted assistance, including explanations, documentation, test creation, and various other forms of support related to your code. For example, you can use:
Context Variables 🎛️
The context variables feature enables you to add files from your solution into your questions using the # symbol. By referencing a file in this way, you allow Copilot to access the content of the file and provide more targeted answers about it. For example, you can ask “How does the #file:’Main.cs’ file work?” or “What is the purpose of the #file:’Calculator.cs’ file?” and get relevant answers from Copilot Chat. You can add multiple files to one question.
That's not it! Besides these main features, you can also explore our other exciting new preview features 👀
For more such updates, keep an eye on the GitHub blog or better "subscribe to our newsletter". 🚀
Beta Was this translation helpful? Give feedback.
All reactions