You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Inline suggestions from GitHub Copilot in VS Code
9
9
10
-
GitHub Copilot acts as an AI-powered pair programmer, automatically offering suggestions to complete your code, comments, tests, and more. It provides these suggestions directly in the editor while you write your code, and it can work with a broad range of programming languages and frameworks.
10
+
GitHub Copilot acts as an AI-powered pair programmer, automatically offering inline suggestions to complete your code, comments, tests, and more. It provides these suggestions directly in the editor while you write your code, and it can work with a broad range of programming languages and frameworks.
11
11
12
-
Copilot provides two kinds of suggestions:
12
+
You may experience two kinds of inline suggestions from Copilot, both of which match your coding style and take your existing code into account:
13
13
14
-
***Code completions** - Start typing in the editor, and Copilot provides code suggestions that match your coding style and take your existing code into account.
14
+
***Ghost text suggestions** - Start typing in the editor, and Copilot provides dimmed *ghost text* suggestions at your current cursor location.
15
15
16
16
***Next edit suggestions** - Predict your next code edit with Copilot next edit suggestions, aka Copilot NES. Based on the edits you're making, NES both predicts the location of the next edit you'll want to make and what that edit should be.
17
17
@@ -24,21 +24,21 @@ Copilot provides two kinds of suggestions:
24
24
1. Sign in with your GitHub account to use Copilot.
25
25
26
26
> [!TIP]
27
-
> If you don't yet have a Copilot subscription, you can use Copilot for free by signing up for the [Copilot Free plan](https://github.com/github-copilot/signup) and get a monthly limit of completions and chat interactions.
27
+
> If you don't yet have a Copilot subscription, you can use Copilot for free by signing up for the [Copilot Free plan](https://github.com/github-copilot/signup) and get a monthly limit of inline suggestions and chat interactions.
28
28
29
29
1. Discover the key features of Copilot in VS Code with our [Copilot Quickstart](/docs/copilot/getting-started.md).
30
30
31
-
## Inline suggestions
31
+
## Getting your first suggestions
32
32
33
-
Copilot offers code suggestions as you type: sometimes the completion of the current line, sometimes a whole new block of code. You can accept all, or part of a suggestion, or you can keep typing and ignore the suggestions.
33
+
Copilot offers dimmed *ghost text* suggestions as you type: sometimes the completion of the current line, sometimes a whole new block of code. You can accept all, or part of a suggestion, or you can keep typing and ignore the suggestions.
34
34
35
35
Notice in the following example how Copilot suggests an implementation of the `calculateDaysBetweenDates` JavaScript function by using dimmed *ghost text*:
36
36
37
37

38
38
39
39
When you're presented with an inline suggestion, you can accept it with the `kbstyle(Tab)` key.
40
40
41
-
Copilot tries to apply the same coding style for the code suggestions that you already have in your code. Notice in the following example that Copilot applies the same input parameter naming scheme from the `add` method for the suggested `subtract` method.
41
+
Copilot tries to apply the same coding style that you already have in your code. Notice in the following example that Copilot applies the same input parameter naming scheme from the `add` method for the suggested `subtract` method.
42
42
43
43

44
44
@@ -62,7 +62,7 @@ The following example shows how to instruct Copilot to create a class in TypeScr
62
62
63
63
## Next edit suggestions
64
64
65
-
Inline suggestions are great at autocompleting a section of code. But since most coding activity is editing existing code, it's a natural evolution of Copilot code completions to also help with edits, both at the cursor and further away. Edits are often not made in isolation - there's a logical flow of what edits need to be made in different scenarios. Next edit suggestions (Copilot NES) is this evolution.
65
+
Ghost text suggestions are great at autocompleting a section of code. But since most coding activity is editing existing code, it's a natural evolution of inline suggestions to also help with edits, both at the cursor and further away. Edits are often not made in isolation - there's a logical flow of what edits need to be made in different scenarios. Next edit suggestions (Copilot NES) is this evolution.
66
66
67
67
<videosrc="./images/inline-suggestions/nes-video.mp4"title="Video showing next edit suggestions in action on a Point typescript class."autoplayloopcontrolsmutedposter="./images/inline-suggestions/point3d.png"></video>
68
68
@@ -117,23 +117,23 @@ By default, edit suggestions are indicated by the gutter arrow and the code chan
117
117
118
118
***Matching code style**. After copy-pasting some code, Copilot will suggest how to adjust it to match the current code where the paste happened.
119
119
120
-
## Enable or disable code completions
120
+
## Enable or disable inline suggestions
121
121
122
-
You can enable or disable code completions either for all languages or for specific languages only. To enable or disable code completions, select the Copilot menu in the Status Bar, and then check or uncheck the options to enable or disable code completions. The option to disable code completions for a specific language is dependent on the language of the active editor.
122
+
You can enable or disable inline suggestions either for all languages or for specific languages only. To enable or disable inline suggestions, select the Copilot menu in the Status Bar, and then check or uncheck the options to enable or disable inline suggestions. The option to disable inline suggestions for a specific language is dependent on the language of the active editor.
123
123
124
124

125
125
126
-
Alternatively, modify the `setting(github.copilot.enable)` setting in the Settings editor. Add an entry for each language you want to enable or disable code completions for. To enable or disable code completions for all languages, set the value for `*` to `true` or `false`.
126
+
Alternatively, modify the `setting(github.copilot.enable)` setting in the Settings editor. Add an entry for each language you want to enable or disable inline suggestions for. To enable or disable inline suggestions for all languages, set the value for `*` to `true` or `false`.
127
127
128
-
To temporarily disable all code completions in the editor, select the Copilot menu in the Status Bar, and then select the **Snooze** button to increment the snooze time by five minutes. To resume code completions, select the **Cancel Snooze** button in the Copilot menu.
128
+
To temporarily disable all inline suggestions in the editor, select the Copilot menu in the Status Bar, and then select the **Snooze** button to increment the snooze time by five minutes. To resume inline suggestions, select the **Cancel Snooze** button in the Copilot menu.
129
129
130
130
Alternatively, use the **Snooze Inline Suggestions** and **Cancel Snooze Inline Suggestions** commands in the Command Palette.
131
131
132
-
## Change the AI model for completions
132
+
## Change the AI model for suggestions
133
133
134
134
Different Large Language Models (LLMs) are trained on different types of data and might have different capabilities and strengths. Learn more about how to [choose between different AI language models](/docs/copilot/customization/language-models.md) in VS Code.
135
135
136
-
To change the language model that is used for generating code completions in the editor:
136
+
To change the language model that is used for generating ghost text suggestions in the editor:
137
137
138
138
1. Open the Command Palette (`kbstyle(F1)`).
139
139
@@ -142,7 +142,7 @@ To change the language model that is used for generating code completions in the
142
142
1. In the dropdown menu, select the model you want to use.
143
143
144
144
> [!NOTE]
145
-
> The list of available models might vary and change over time. The model picker may not always show more than one model, and preview models and additional code completion models will become available there if/when we release them. If you are a Copilot Business or Enterprise user, your Administrator needs to enable certain models for your organization by opting in to `Editor Preview Features` in the [Copilot policy settings](https://docs.github.com/en/enterprise-cloud@latest/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#enabling-copilot-features-in-your-organization) on GitHub.com.
145
+
> The list of available models might vary and change over time. The model picker may not always show more than one model, and preview models and additional inline suggestion models will become available there if/when we release them. If you are a Copilot Business or Enterprise user, your Administrator needs to enable certain models for your organization by opting in to `Editor Preview Features` in the [Copilot policy settings](https://docs.github.com/en/enterprise-cloud@latest/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#enabling-copilot-features-in-your-organization) on GitHub.com.
146
146
147
147
## Tips & tricks
148
148
@@ -152,7 +152,7 @@ To give you relevant inline suggestions, Copilot looks at the current and open f
152
152
153
153
## Settings
154
154
155
-
### Code completions settings
155
+
### Ghost text suggestions settings
156
156
157
157
*`setting(github.copilot.enable)` - enable or disable inline completions for all or specific languages.
Copy file name to clipboardExpand all lines: docs/copilot/copilot-tips-and-tricks.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ Depending on your task, you can choose between different Copilot tools.
30
30
31
31
| Tool | Use case |
32
32
|------|----------|
33
-
|[Code completions](/docs/copilot/ai-powered-suggestions.md)| Streamline coding while staying in the flow.<br/>Receive inline suggestions for code snippets, variable names, and functions as you write them in the editor. |
33
+
|[Inline suggestions](/docs/copilot/ai-powered-suggestions.md)| Streamline coding while staying in the flow.<br/>Receive inline suggestions for code snippets, variable names, and functions as you write them in the editor. |
34
34
|[Chat](/docs/copilot/chat/copilot-chat.md)| Have an ongoing chat conversation for brainstorming design ideas or getting code suggestions, optionally calling on domain-specific chat participants.<br/>Choose to apply specific code suggestions to your codebase. |
35
35
|[Agent mode](/docs/copilot/chat/copilot-chat.md#built-in-chat-modes)| Implement high-level requirements by starting an agentic coding flow.<br/>Copilot autonomously invokes multiple tools to plan and implement the code changes and tasks that are needed. |
Copy file name to clipboardExpand all lines: docs/copilot/customization/custom-instructions.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ Custom instructions enable you to define common guidelines and rules that automa
11
11
You can configure custom instructions to apply automatically to all chat requests or to specific files only. Alternatively, you can manually attach custom instructions to a specific chat prompt.
12
12
13
13
> [!NOTE]
14
-
> Custom instructions are not taken into account for [code completions](/docs/copilot/ai-powered-suggestions.md) as you type in the editor.
14
+
> Custom instructions are not taken into account for [inline suggestions](/docs/copilot/ai-powered-suggestions.md) as you type in the editor.
Visual Studio Code offers different built-in language models that are optimized for different tasks. You can also bring your own language model API key to use models from other providers. This article describes how to change the language model for chat or code completions, and how to use your own API key.
9
+
Visual Studio Code offers different built-in language models that are optimized for different tasks. You can also bring your own language model API key to use models from other providers. This article describes how to change the language model for chat or inline suggestions, and how to use your own API key.
10
10
11
11
## Choose the right model for your task
12
12
@@ -65,16 +65,16 @@ If you want to reduce the number of built-in models that are shown in the model
65
65
66
66

67
67
68
-
## Change the model for code completions
68
+
## Change the model for inline suggestions
69
69
70
-
To change the language model that is used for generating code completions in the editor:
70
+
To change the language model that is used for generating inline suggestions in the editor:
71
71
72
-
1. Select **Configure Code Completions...** from the Chat menu in the VS Code title bar.
72
+
1. Select **Configure Inline Suggestions...** from the Chat menu in the VS Code title bar.
73
73
74
74
1. Select **Change Completions Model...**, and then select one of the models from the list.
75
75
76
76
> [!NOTE]
77
-
> The models that are available for code completions might evolve over time as we add support for more models.
77
+
> The models that are available for inline suggestions might evolve over time as we add support for more models.
78
78
79
79
## Bring your own language model key
80
80
@@ -159,7 +159,7 @@ Alternatively, you can manually add your custom model configuration in the `sett
159
159
160
160
There are a number of considerations when using your own language model API key in VS Code:
161
161
162
-
* Bringing your own model only applies to the chat experience and doesn't impact code completions or other AI-powered features in VS Code, such as commit-message generation.
162
+
* Bringing your own model only applies to the chat experience and doesn't impact inline suggestions or other AI-powered features in VS Code, such as commit-message generation.
163
163
* The capabilities of each model might differ from the built-in models and could affect the chat experience. For example, some models might not support vision or tool calling.
164
164
* The Copilot API is still used for some tasks, such as sending embeddings, repository indexing, query refinement, intent detection, and side queries.
165
165
* When using your own model, there is no guarantee that responsible AI filtering is applied to the model's output.
@@ -180,7 +180,7 @@ You can use locally hosted models in chat by using [bring your own model key](#b
180
180
* Install an extension from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/search?term=tag%3Alanguage-models&target=VSCode&category=All%20categories&sortBy=Relevance), for example, [AI Toolkit for VS Code with Foundry Local](https://aka.ms/AIToolkit)
181
181
* Configure a [custom OpenAI-compatible model](#use-an-openai-compatible-model)
182
182
183
-
Currently, you cannot connect to a local model for code completions. VS Code provides an extension API [`InlineCompletionItemProvider`](/api/references/vscode-api.md#InlineCompletionItemProvider) that enables extensions to contribute a custom completion provider. You can get started with our [Inline Completions sample](https://github.com/microsoft/vscode-extension-samples/blob/main/inline-completions).
183
+
Currently, you cannot connect to a local model for inline suggestions. VS Code provides an extension API [`InlineCompletionItemProvider`](/api/references/vscode-api.md#InlineCompletionItemProvider) that enables extensions to contribute a custom completion provider. You can get started with our [Inline Completions sample](https://github.com/microsoft/vscode-extension-samples/blob/main/inline-completions).
184
184
185
185
> [!NOTE]
186
186
> Currently, using a locally hosted models still requires the Copilot service for some tasks. Therefore, your GitHub account needs to have access to a Copilot plan (for example, Copilot Free) and you need to be online. This requirement might change in a future release.
0 commit comments