Skip to content

Repo sync for protected branch #10343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 47 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
4be5e3d
Updates for WAM as default
anandmeg Jul 15, 2024
d237e26
add link
anandmeg Jul 15, 2024
35f65bb
Fix build error
anandmeg Jul 15, 2024
c020482
Update image
anandmeg Jul 15, 2024
553b4c0
Fix per feedback
anandmeg Jul 19, 2024
20e964c
Additional updates
anandmeg Jul 19, 2024
8a73cf0
Additional updates
anandmeg Jul 19, 2024
5956b53
keyboard shortcut for toggle comment
anandmeg Aug 5, 2024
4f5af31
add VS versopm
anandmeg Aug 6, 2024
2480e47
ms.date to VS release date
anandmeg Aug 6, 2024
e387ad2
doc content exclusions
anandmeg Aug 6, 2024
d802d23
completions update
anandmeg Aug 7, 2024
cf4197c
updates
anandmeg Aug 7, 2024
6cc33d3
add screenshots
anandmeg Aug 7, 2024
7b92084
Fix path to images
anandmeg Aug 7, 2024
2f659b8
fix build warnings
anandmeg Aug 7, 2024
b9955db
updates
anandmeg Aug 7, 2024
0b4b0e2
exclusions changes
anandmeg Aug 7, 2024
603e475
Updates for 17.11 context features
anandmeg Aug 9, 2024
cf71fef
Add doc update on promoting linline chat to chat window
anandmeg Aug 12, 2024
218635c
Link to release notes
anandmeg Aug 12, 2024
8af62c8
Update doc for how to modify code suggestions
anandmeg Aug 12, 2024
a19c526
modify screenshot
anandmeg Aug 12, 2024
a4d9725
Updates
anandmeg Aug 12, 2024
78c2351
Fix bookmarks
anandmeg Aug 12, 2024
c3a0d6a
Fix build errors
anandmeg Aug 12, 2024
9ab30e4
Fix build errors
anandmeg Aug 12, 2024
12647d3
Add H3s
anandmeg Aug 12, 2024
e9dc622
Fix screenshot
anandmeg Aug 12, 2024
6f7f5af
Fix links
anandmeg Aug 12, 2024
b744315
Add info on moving inline chat to chat window
anandmeg Aug 13, 2024
e1e70eb
Add screenshot
anandmeg Aug 13, 2024
3a69e31
Update H2s
anandmeg Aug 13, 2024
fd7c7b9
fix screenshot
anandmeg Aug 13, 2024
27f70e8
Fix numbering
anandmeg Aug 13, 2024
58380f3
Fix image name
anandmeg Aug 13, 2024
e284d4e
Fix image name
anandmeg Aug 13, 2024
b841529
Revert ms date
anandmeg Aug 13, 2024
20fa183
Fix spacing
anandmeg Aug 13, 2024
08ae738
Merge pull request #12873 from anandmeg/shortcuts
prmerger-automator[bot] Aug 13, 2024
7fe68d8
Merge pull request #12798 from anandmeg/wam-updates
Stacyrch140 Aug 13, 2024
39e2bae
pencil edit
Stacyrch140 Aug 13, 2024
c35e13b
pencil edit
Stacyrch140 Aug 13, 2024
ae08b4d
Merge pull request #12878 from anandmeg/copilot-exclusions
Stacyrch140 Aug 13, 2024
dfb8eb4
Merge pull request #12880 from anandmeg/copilot-1711-a
Stacyrch140 Aug 13, 2024
1bb7590
Merged main into live
mijacobs Aug 13, 2024
c5c0efd
Merging changes synced from https://github.com/MicrosoftDocs/visualst…
Aug 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 35 additions & 8 deletions docs/ide/copilot-chat-context.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: 'Tips & Tricks for GitHub Copilot Chat in Visual Studio'
description: Use slash commands, references, and threads to form better questions and get better answers with scoped context in GitHub Copilot Chat.
ms.date: 7/29/2024
ms.date: 8/13/2024
ms.topic: how-to
author: anandmeg
ms.author: meghaanand
Expand Down Expand Up @@ -56,25 +56,42 @@ You can use slash commands in a [chat window](visual-studio-github-copilot-chat.

## <a name="reference"></a>Reference: scope Copilot results to a particular file or entire solution

You can ask your coding related questions in natural language and GitHub Copilot Chat will answer these in the context of the codebase open in Visual Studio. With references you can get more specific about the information you want Copilot to consider when answering your question. By selecting a specific context in your codebase, you're able to form better questions easily without having to write out or paste long pieces of information. Specifying the context also enables Copilot to provide you with more relevant answers.
You can ask your coding related questions in natural language and GitHub Copilot Chat will answer these in the context of the codebase open in Visual Studio. With references you can get more specific about the information you want Copilot to consider when answering your question.

To easily reference a file, simply add a *#* symbol at the beginning of the file name. For example, if you have a file named *BasketService.cs*, refer to it in the chat as *#BasketService.cs*.
By selecting a specific context in your codebase, you're able to form better questions easily without having to write out or paste long pieces of information. Specifying the context also enables Copilot to provide you with more relevant answers.

### Reference a file

To easily reference a file in GitHub Copilot Chat, simply add a *#* symbol at the beginning of the file name. For example, if you have a file named *BasketService.cs*, refer to it in the chat as *#BasketService.cs*.

:::image type="content" source="media/vs-2022/copilot-chat-context/copilot-chat-context-hash-reference.png" alt-text="Screenshot of references in Copilot Chat.":::

Use *#solution* to refer to the solution active in the IDE for context.
### Reference a method, class, or function

With [Visual Studio 2022 version 17.11](/visualstudio/releases/2022/release-notes), you can now reference a specific method, class, or function in GitHub Copilot Chat.

To easily reference a method, class, or function in GitHub Copilot Chat, simply add a *#* symbol at the beginning of the method, class, or function name. For example, if you have a method named *BasketAddItem*, refer to it in the chat as *#BasketAddItem*.

:::image type="content" source="media/vs-2022/copilot-chat-context/copilot-chat-references-methods.png" alt-text="Screenshot of references to methods in GitHub Copilot Chat in Visual Studio.":::

### Reference the entire solution

Use *@workspace* to refer to the solution active in the IDE for context. When using *@workspace* for context, Copilot Chat leverages the information about the files, projects, and configurations that are currently open and being worked on within your IDE. This enables Copilot Chat to provide more relevant and context-aware suggestions and answers.

:::image type="content" source="media/vs-2022/copilot-chat-context/copilot-chat-context-hash-solution-reference.gif" alt-text="Screenshot of referencing solution context in Copilot Chat.":::
:::image type="content" source="media/vs-2022/copilot-chat-context/copilot-chat-context-at-workspace.gif" alt-text="Screenshot of referencing solution context in Copilot Chat.":::

### Usage examples
Here are some examples of using references for context control:

| **Example** | **Context used by Copilot to form the question** |
|---------------------------|:--------------------:|
| What is the purpose of #MyFile.cs: 66-72?| Exact section of the file |
| Where are the tests in #BasketService.cs?| BasketService.cs |
| /explain the AddItemToBasket method in #BasketService.cs| AddItemToBasket method in BasketService.cs |
| Is there a delete basket method in this #solution| Current Solution open in the IDE|

| /explain the #AddItemToBasket in #BasketService.cs| AddItemToBasket method in BasketService.cs |
| Is there a delete basket method in this @workspace| Current solution open in the IDE |
| I have a test method named #TestCalculator. How can I ensure that it's being executed correctly?| TestCalculator method |
| Could you explain the differences between classes #BasketService and #OrderService?| BasketService class and OrderService class |
| In my @workspace where is #AddItemToBasket? | Current solution open in the IDE |

## <a name="find-context"></a>Review the sources used by Copilot Chat

Expand All @@ -86,14 +103,24 @@ Copilot Chat displays the context it used after every result, so that you can te

If you’re using Copilot Chat extensively to ask questions as you code, you can organize your conversations in a way that keeps them on-topic. Copilot Chat for Visual Studio now provides an easy way to start new conversations (threads) to keep them focused on the task at hand, and keep the context clear so the answers are based on relevant history.

### <a name="new-thread"></a>New chat thread

You can start a new thread by selecting the **Create new thread** in the chat window.

:::image type="content" source="media/vs-2022/copilot-chat-context/copilot-chat-new-thread-conversation.png" alt-text="Screenshot of Create new thread icon in Copilot Chat.":::

### <a name="switch-thread"></a>Switch chat thread

You can select between multiple ongoing threads to provide the right historical context for your question.

:::image type="content" source="media/vs-2022/copilot-chat-context/copilot-chat-switch-threads.png" alt-text="Screenshot of switching between ongoing threads in Copilot Chat.":::

### <a name="promote-inline"></a>Promote inline chat to the chat window

With [Visual Studio 2022 version 17.11](/visualstudio/releases/2022/release-notes), you can now preserve the history of your [inline chat](visual-studio-github-copilot-chat.md#ask-questions-in-the-inline-chat-view) by promoting it to the [chat window](visual-studio-github-copilot-chat.md#ask-questions-in-the-chat-window). Select **Continue in chat window...** to maintain a record and context of the conversation, and continue in the chat window.

:::image type="content" source="media/vs-2022/copilot-chat-context/promote-inline-chat-to-chat-window.png" alt-text="Screenshot of promoting ongoing thread in inline chat to the chat window.":::

## Next steps

- [GitHub Copilot extension for Visual Studio](visual-studio-github-copilot-extension.md)
Expand Down
5 changes: 3 additions & 2 deletions docs/ide/default-keyboard-shortcuts-in-visual-studio.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Keyboard shortcuts
description: Learn about the default keyboard shortcuts in Visual Studio that allow you to access a variety of commands and windows.
ms.date: 05/21/2024
ms.date: 08/13/2024
ms.topic: reference
helpviewer_keywords:
- shortcut keys [Visual Studio], keyboard binding schemes
Expand Down Expand Up @@ -39,7 +39,7 @@ All shortcuts in this section apply globally unless otherwise specified. The *Gl
> [!TIP]
> You can [look up the shortcut](identifying-and-customizing-keyboard-shortcuts-in-visual-studio.md) for any command by opening the **Options** dialog box, expanding the **Environment** node, and then choosing **Keyboard**.

- [Build](../ide/default-keyboard-shortcuts-in-visual-studio.md#bkmk_build-popular-shortcuts)
- [Build](#bkmk_build-popular-shortcuts)
- [Debug](../ide/default-keyboard-shortcuts-in-visual-studio.md#bkmk_debug-popular-shortcuts)
- [Edit](../ide/default-keyboard-shortcuts-in-visual-studio.md#bkmk_edit-popular-shortcuts)
- [File](../ide/default-keyboard-shortcuts-in-visual-studio.md#bkmk_file-popular-shortcuts)
Expand Down Expand Up @@ -124,6 +124,7 @@ All shortcuts in this section apply globally unless otherwise specified. The *Gl
|Toggle all outlining|**Ctrl+M, Ctrl+L** [Text Editor]| Edit.ToggleAllOutlining |
|Toggle bookmark|**Ctrl+K, Ctrl+K** [Text Editor]| Edit.ToggleBookmark |
|Toggle completion mode|**Ctrl+Alt+Space** [Text Editor]| Edit.ToggleCompletionMode |
|Toggle line comment|**Ctrl+/** [Text Editor] <br>(available in [Visual Studio 2022 version 17.11 or later](/visualstudio/releases/2022/release-notes))<br /><br />or **Ctrl+K, Ctrl+/** [Text Editor] | Edit.ToggleLineComment |
|Toggle outlining expansion|**Ctrl+M, Ctrl+M** [Text Editor]| Edit.ToggleOutliningExpansion |
|Uncomment selection|**Ctrl+K, Ctrl+U** [Text Editor]| Edit.UncommentSelection |
|Undo|**Ctrl+Z**<br /><br />or **Alt+Backspace**| Edit.Undo |
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 38 additions & 7 deletions docs/ide/visual-studio-github-copilot-admin.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Admin controls for GitHub Copilot in Visual Studio
description: Learn about the new features for administrators in GitHub Copilot for Visual Studio that enable admins to manage Copilot effectively.
ms.date: 7/30/2024
ms.date: 8/13/2024
ms.topic: how-to
author: anandmeg
ms.author: meghaanand
Expand All @@ -13,17 +13,19 @@ monikerRange: vs-2022

# Admin controls for GitHub Copilot

Visual Studio 2022 version 17.10 introduces new features for administrators to configure and manage GitHub Copilot for their enterprise effectively.
In this article, you learn how to disable Copilot for individual accounts or disable Copilot altogether.
Visual Studio 2022 introduces new features for administrators to configure and manage GitHub Copilot for their enterprise effectively. These features provide administrators greater control over the use of Copilot within their organization. Admins can disable Copilot

In this article, you learn how to:
- [Disable Copilot](#disabling-copilot-for-individual-enterprise-visual-studio-accounts)
- [Configure content exclusion](#configure-content-exclusion)

## Disabling Copilot for individual Enterprise Visual Studio accounts

In version 17.10, we're introducing two new features to disable Copilot, ensuring that your repository is protected.
Project administrators can disable Copilot for individual accounts or disable Copilot altogether via the [Visual Studio Administrative Templates (ADMX/ADML)](https://www.microsoft.com/en-us/download/details.aspx?id=104405). These features provide administrators with greater control over the use of Copilot within their organization.
With Visual Studio version 17.10, project administrators can disable Copilot for individual accounts or disable Copilot altogether via the [Visual Studio Administrative Templates (ADMX/ADML)](https://www.microsoft.com/en-us/download/details.aspx?id=104405), ensuring that your repository is protected.

To configure and deploy these policies, you can use [Microsoft Intune](../install/administrative-templates.md#deploying-the-policies) or the Local Group Policy Editor directly on the client machine.
To configure and deploy these policies, you can use [Microsoft Intune](../install/administrative-templates.md#deploying-the-policies) or the [Local Group Policy Editor](#configure-copilot-group-policy) directly on the client machine.

## Configure Copilot group policy
### Configure Copilot group policy

1. Head over to the Microsoft Download Center and grab the Visual Studio [Group Policy Administrative Template files (ADMX/ADML)](https://www.microsoft.com/en-us/download/details.aspx?id=104405). It asks you where you want the files to be downloaded, ensure the location is `C:\Windows\PolicyDefinitions`.

Expand All @@ -37,3 +39,32 @@ To configure and deploy these policies, you can use [Microsoft Intune](../instal

4. Restart your Visual Studio instance to pick up the new policy changes

## Configure content exclusion

Content exclusion for GitHub Copilot enables administrators to prevent certain files from being available to Copilot and keep sensitive content secure from Copilot use. You can use content exclusions to configure GitHub Copilot to ignore specific files in a [repository](https://docs.github.com/en/copilot/managing-github-copilot-in-your-organization/configuring-content-exclusions-for-github-copilot#configuring-content-exclusions-for-your-organization) or [organization](https://docs.github.com/en/copilot/managing-github-copilot-in-your-organization/configuring-content-exclusions-for-github-copilot#configuring-content-exclusions-for-your-repository). Content exclusion is only available with a GitHub Copilot Business or a GitHub Copilot Enterprise subscription.

With [Visual Studio 2022 version 17.11](/visualstudio/releases/2022/release-notes), GitHub Copilot for Visual Studio will ignore excluded content. When you exclude content from Copilot, completions and chat aren't available on the affected files.

### GitHub Copilot Completions in Visual Studio and content exclusions

- Code completions aren't available on excluded files.

:::image type="content" source="media/vs-2022/visual-studio-github-copilot-admin/copilot-content-exclusions-completions.png" alt-text="Screenshot of Copilot completions on an excluded file." lightbox="media/vs-2022/visual-studio-github-copilot-admin/copilot-content-exclusions-completions.png":::

- Excluded content isn't included in code completion suggestions in other files.

### GitHub Copilot Chat in Visual Studio and content exclusions

- Excluded files can't be referenced in the chat window or in inline chat.

**Chat window**

:::image type="content" source="media/vs-2022/visual-studio-github-copilot-admin/copilot-content-exclusions-chat-window.png" alt-text="Screenshot of using an excluded file in chat window." lightbox="media/vs-2022/visual-studio-github-copilot-admin/copilot-content-exclusions-chat-window.png":::

**Inline chat**

:::image type="content" source="media/vs-2022/visual-studio-github-copilot-admin/copilot-content-exclusions-chat-inline.png" alt-text="Screenshot of using an excluded file in inline chat." lightbox="media/vs-2022/visual-studio-github-copilot-admin/copilot-content-exclusions-chat-inline.png":::

- Excluded content isn't included in GitHub Copilot Chat's responses.

:::image type="content" source="media/vs-2022/visual-studio-github-copilot-admin/copilot-content-exclusions-chat-response.png" alt-text="Screenshot of chat's responses on excluded content." lightbox="media/vs-2022/visual-studio-github-copilot-admin/copilot-content-exclusions-chat-response.png":::
9 changes: 8 additions & 1 deletion docs/ide/visual-studio-github-copilot-chat.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: About GitHub Copilot Chat in Visual Studio
description: Learn about the fully integrated GitHub Copilot Chat in Visual Studio. Use the chat interface to ask coding-related questions from right within the IDE.
ms.date: 7/29/2024
ms.date: 8/13/2024
ms.topic: overview
author: anandmeg
ms.author: meghaanand
Expand Down Expand Up @@ -56,6 +56,9 @@ There are two places you can ask Copilot these questions; in a [chat window](#as

See [tips to improve Copilot chat](copilot-chat-context.md) results to learn how to use [slash commands](copilot-chat-context.md#slash-commands), [references](copilot-chat-context.md#reference), [sources used](copilot-chat-context.md#find-context), and [threads](copilot-chat-context.md#threads) to get better answers with scoped context in Copilot Chat.

>[!NOTE]
>With Visual Studio 2022 version 17.11, [content exclusion is available for GitHub Copilot Chat](visual-studio-github-copilot-admin.md#github-copilot-chat-in-visual-studio-and-content-exclusions) in Visual Studio. Content excluded by your admin will now be ignored in chat's responses. See [configuring content exclusions for GitHub Copilot](https://docs.github.com/copilot/managing-github-copilot-in-your-organization/configuring-content-exclusions-for-github-copilot?tool=visualstudio) to learn more.

### Ask questions in the chat window

The chat window of Copilot Chat in Visual Studio enables you to ask your questions and see answers in the chat pane. It is usually the best way to work with Copilot on programming help and general coding questions.
Expand Down Expand Up @@ -95,6 +98,10 @@ The inline chat view of Copilot Chat in Visual Studio enables you to ask your qu

:::image type="content" source="media/vs-2022/visual-studio-github-copilot-chat/copilot-chat-inline-diff-view.png" alt-text="Screenshot of code suggestions in Visual Studio diff view." lightbox="media/vs-2022/visual-studio-github-copilot-chat/copilot-chat-inline-diff-view.png" :::

1. You can promote your inline chat thread to the chat window by selecting **Continue in chat window**. This'll preserve the record and context of your conversation, and you can continue in the chat window.

:::image type="content" source="media/vs-2022/visual-studio-github-copilot-chat/promote-inline-chat-to-chat-window.png" alt-text="Screenshot of how to continue the inline chat thread in the chat window." :::

1. You can close the inline chat view by pressing **Esc**.

## Next steps
Expand Down
Loading