|
1 | 1 | --- |
2 | 2 | title: About GitHub Copilot Completions in Visual Studio |
3 | 3 | description: Use GitHub Copilot Completions in Visual Studio to use AI assistance to generate information about your code, including suggested edits and new code snippets. |
4 | | -ms.date: 11/17/2025 |
| 4 | +ms.date: 12/17/2025 |
5 | 5 | ms.update-cycle: 180-days |
6 | 6 | ms.topic: overview |
7 | 7 | author: anandmeg |
@@ -59,15 +59,31 @@ As you type code or comments in the editor, GitHub Copilot provides context-awar |
59 | 59 | int subtractNumbers( |
60 | 60 | ``` |
61 | 61 |
|
62 | | -1. Hover over the suggestion to see the GitHub Copilot command palette. |
| 62 | +:::moniker range="visualstudio" |
| 63 | + |
| 64 | +4. Press enter to see the GitHub Copilot command palette. |
| 65 | + |
| 66 | + To accept the suggestion, select the <kbd>Tab</kbd> key. To reject the suggestion, select the <kbd>Esc</kbd> key or continue typing. |
| 67 | + |
| 68 | + :::image type="content" source="media/visualstudio/visual-studio-github-copilot-extension/copilot-accept-code-suggestions.png" alt-text="Screenshot that shows suggestions to accept or modify a GitHub Copilot code suggestion in Visual Studio."::: |
| 69 | + |
| 70 | + If the command palette doesn't appear, you might have reached the default limit for its display. To change this limit, go to **Tools** > **Options** > **IntelliCode** > **Advanced**, and adjust the value for **Minimum commits to suppress hint text**. |
| 71 | + |
| 72 | +:::moniker-end |
| 73 | + |
| 74 | +:::moniker range="vs-2022" |
| 75 | + |
| 76 | +4. Hover over the suggestion to see the GitHub Copilot command palette. |
63 | 77 |
|
64 | 78 | To accept the suggestion, select the <kbd>Tab</kbd> key. To reject the suggestion, continue typing. |
65 | 79 |
|
66 | 80 | :::image type="content" source="media/vs-2022/visual-studio-github-copilot-extension/copilot-accept-code-suggestions.png" alt-text="Screenshot that shows suggestions to accept or modify a GitHub Copilot code suggestion in Visual Studio."::: |
67 | 81 |
|
68 | 82 | If the command palette doesn't appear, you might have reached the default limit for its display. To change this limit, go to **Tools** > **Options** > **IntelliCode** > **Advanced**, and adjust the value for **Minimum commits to suppress hint text**. |
69 | 83 |
|
70 | | -1. Add the following code to see completions from GitHub Copilot: |
| 84 | +:::moniker-end |
| 85 | + |
| 86 | +5. Add the following code to see completions from GitHub Copilot: |
71 | 87 |
|
72 | 88 | ```csharp |
73 | 89 | int a = 5; |
@@ -111,33 +127,51 @@ With Visual Studio 2022 version 17.11, [content exclusion is available for GitHu |
111 | 127 |
|
112 | 128 | With Visual Studio 2022 version 17.13, code referencing is available for GitHub Copilot Completions. If you or your organization [enabled suggestions that match public code](https://docs.github.com/en/copilot/managing-copilot/managing-copilot-as-an-individual-subscriber/managing-copilot-policies-as-an-individual-subscriber#enabling-or-disabling-suggestions-matching-public-code), Copilot notifies you when you accept a completion that matches code from a public GitHub repository. |
113 | 129 |
|
114 | | -:::image type="content" source="media/vs-2022/visual-studio-github-copilot-extension/github-copilot-completions-code-referencing.png" alt-text="Screenshot that shows GitHub Copilot Completions code referencing in Visual Studio." lightbox="media/vs-2022/visual-studio-github-copilot-extension/github-copilot-completions-code-referencing.png":::::: |
| 130 | +:::moniker range="visualstudio" |
| 131 | + |
| 132 | +:::image type="content" source="media/visualstudio/visual-studio-github-copilot-extension/github-copilot-completions-code-referencing.png" alt-text="Screenshot that shows GitHub Copilot Completions code referencing in Visual Studio." lightbox="media/visualstudio/visual-studio-github-copilot-extension/github-copilot-completions-code-referencing.png"::: |
| 133 | + |
| 134 | +To see detailed information in GitHub Copilot logs in the **Output** window, select **View code matches**. The log entry includes a link to a GitHub.com page where you can view details on license type. It also includes references to similar code in public GitHub repositories. |
| 135 | + |
| 136 | +:::image type="content" source="media/visualstudio/visual-studio-github-copilot-extension/code-referencing-copilot-logs.png" alt-text="Screenshot that shows the log entry for a code reference in an output window." lightbox="media/visualstudio/visual-studio-github-copilot-extension/code-referencing-copilot-logs.png"::: |
| 137 | + |
| 138 | +:::moniker-end |
| 139 | + |
| 140 | +:::moniker range="vs-2022" |
| 141 | + |
| 142 | +:::image type="content" source="media/vs-2022/visual-studio-github-copilot-extension/github-copilot-completions-code-referencing.png" alt-text="Screenshot that shows GitHub Copilot Completions code referencing in Visual Studio." lightbox="media/vs-2022/visual-studio-github-copilot-extension/github-copilot-completions-code-referencing.png"::: |
115 | 143 |
|
116 | 144 | To see detailed information in GitHub Copilot logs in the **Output** window, select **View code matches**. The log entry includes a link to a GitHub.com page where you can view details on license type. It also includes references to similar code in public GitHub repositories. |
117 | 145 |
|
118 | 146 | :::image type="content" source="media/vs-2022/visual-studio-github-copilot-extension/code-referencing-copilot-logs.png" alt-text="Screenshot that shows the log entry for a code reference in an output window." lightbox="media/vs-2022/visual-studio-github-copilot-extension/code-referencing-copilot-logs.png"::: |
119 | 147 |
|
| 148 | +:::moniker-end |
| 149 | + |
120 | 150 | Code referencing enables you to make an informed decision on using code attribution or removing the code from your project. |
121 | 151 |
|
122 | 152 | ## Completions model |
123 | 153 |
|
124 | | -The GPT-4o Copilot model for code completions is available for GitHub Copilot in Visual Studio version 17.14 Preview 2 or later. |
| 154 | +:::moniker range="visualstudio" |
125 | 155 |
|
126 | | -To try the new model for better suggestions and performance: |
| 156 | +The GPT-4.1 Copilot model for code completions is available for GitHub Copilot in Visual Studio. |
127 | 157 |
|
128 | | -:::moniker range="visualstudio" |
| 158 | +To try the new model for better suggestions and performance: |
129 | 159 |
|
130 | 160 | 1. In the **Tools** > **Options** pane, expand the **All Settings** > **Text Editor** > **Code Completions** > **General** section. |
131 | 161 |
|
132 | | -1. Set the **Copilot Completions Model** option to **GPT-4o Copilot**. |
| 162 | +1. Set the **Copilot Completions Model** option to **GPT-4.1 Copilot**. |
133 | 163 |
|
134 | | - If the GPT-4o model isn't listed, try restarting Visual Studio to retrieve the latest model list. |
| 164 | + If the GPT-4.1 model isn't listed, try restarting Visual Studio to retrieve the latest model list. |
135 | 165 |
|
136 | | - :::image type="content" source="media/visualstudio/completions-model-picker.png" border="false" alt-text="Screenshot that shows how to select the Copilot completions model."::: |
| 166 | + :::image type="content" source="media/visualstudio/visual-studio-github-copilot-extension/completions-model-picker.png" border="false" alt-text="Screenshot that shows how to select the Copilot completions model."::: |
137 | 167 |
|
138 | 168 | :::moniker-end |
139 | 169 | :::moniker range="<=vs-2022" |
140 | 170 |
|
| 171 | +The GPT-4.1 Copilot model for code completions is available for GitHub Copilot in Visual Studio version 17.14 Preview 2 or later. |
| 172 | + |
| 173 | +To try the new model for better suggestions and performance: |
| 174 | + |
141 | 175 | 1. In the **Tools** > **Options** dialog, expand the **GitHub** > **Copilot** section. |
142 | 176 |
|
143 | 177 | 1. In the **Copilot Completions** group, set the **Copilot Completions Model** option to **GPT-4o Copilot**. |
|
0 commit comments