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
Copy file name to clipboardExpand all lines: docs/ide/copilot-next-edit-suggestions.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ monikerRange: '>= vs-2022'
12
12
---
13
13
# Use Copilot Next Edit Suggestions in Visual Studio
14
14
15
-
Next edit suggestions use recent edits you’ve made to anticipate the next edit you might want to make, and the location of that edit. With this new ability, GitHub Copilot suggests revisions to your code, comments, tests, and more.
15
+
Next edit suggestions use recent edits you make to anticipate the next edit you might want to make, and the location of that edit. With this new ability, GitHub Copilot suggests revisions to your code, comments, tests, and more.
16
16
17
17
Inline completions are great at autocompleting a section of code. Copilot NES helps you stay in the logical edit flow, suggesting changes relevant to your current work, and you can simply `Tab` to quickly navigate and accept Copilot's suggestions. Suggestions may span a single symbol, an entire line, or multiple lines, depending on the scope of the potential change.
18
18
@@ -29,27 +29,27 @@ To get started with Copilot NES, enable the feature in **Tools > Options > GitHu
29
29
30
30
## Use next edit suggestions
31
31
32
-
As with completions, to start getting suggestions from NES, start coding. When Copilot suggests code edits, you can navigate to it with the `Tab` key, and then accept it with the `Tab` key again. You’ll save time by quickly jumping to the next relevant edit, without needing to manually search through files or references yourself. An arrow in the gutter indicates whether an edit suggestion is available.
32
+
To start getting suggestions from NES, start coding. When Copilot suggests code edits, you can navigate to it with the `Tab` key, and then accept it with the `Tab` key again. You save time by quickly jumping to the next relevant edit, without needing to manually search through files or references yourself. An arrow in the gutter indicates whether an edit suggestion is available.
33
33
34
34
An arrow in the gutter indicates if there is an edit suggestion available. Click the arrow to explore the edit suggestion menu, which includes keyboard shortcuts.
35
35
36
36
:::image type="content" source="media/vs-2022/next-edit-suggestions/next-edit-suggestions-arrows.png" alt-text="Screenshot that shows arrows in gutter indicating next edit suggestions.":::
37
37
38
-
If an edit suggestion is below the current editor view, the arrow will point down instead of right. Scroll past an edit suggestion and the arrow hints the location of the next edit suggestion, pointing up or down based on where you're in the file.
38
+
If an edit suggestion is below the current editor view, the arrow points down instead of right. Scroll past an edit suggestion and the arrow hints the location of the next edit suggestion, pointing up or down based on where you're in the file.
39
39
40
40
:::image type="content" source="media/vs-2022/next-edit-suggestions/arrow-upward.png" alt-text="Screenshot that shows arrow pointing upward to indicate next edit suggestion location in file.":::
41
41
42
42
## Use cases for Next Edit Suggestions
43
43
44
-
NES is helpful in a variety of scenarios, not only making obvious repetitive changes, but also logical changes. Here are some examples:
44
+
NES is helpful in various scenarios, not only making obvious repetitive changes, but also logical changes. Here are some examples:
45
45
46
46
### Catch and correct mistakes
47
47
48
48
- NES helps with mistakes like typos, for example, if you wrote `bol` instead of `bool`.
49
49
50
50
:::image type="content" source="media/vs-2022/next-edit-suggestions/fix-typo.png" alt-text="Screenshot that shows NES suggesting typo correction.":::
51
51
52
-
- Copilot can also help with more challenging mistakes in logic, like an inverted ternary expression or a comparison that should've used`||` instead of `&&`.
52
+
- Copilot can also help with more challenging mistakes in logic, like an inverted ternary expression or a comparison that should use`||` instead of `&&`.
53
53
54
54
:::image type="content" source="media/vs-2022/next-edit-suggestions/ternary-expression.png" alt-text="Screenshot that shows NES suggesting the correction for an expression.":::
55
55
@@ -61,17 +61,17 @@ NES suggests changes to the rest of your code that match a change in intent. For
61
61
62
62
### Update code syntax
63
63
64
-
NES helps with repetitive changes like updating code synx to modern c++ using STL. For example, when updating all `printf()` to `std::cout`, also update other syntax such as `fgets()`.
64
+
NES helps with repetitive changes like updating code synx to modern [C++ using Standard library (STL) reference](/cpp/standard-library/cpp-standard-library-reference.md). For example, when updating all `printf()` to `std::cout`, also update other syntax such as `fgets()`.
65
65
66
66
:::image type="content" source="media/vs-2022/next-edit-suggestions/update-code-syntax.gif" alt-text="Animated screenshot that shows NES suggesting code syntax updates" lightbox="media/vs-2022/next-edit-suggestions/update-code-syntax.gif":::
67
67
68
68
### Refactor
69
69
70
-
- Rename a variable once in a file, and NES will suggest to update it everywhere else. If you use a new name or naming pattern, Copilot suggests to update subsequent code similarly.
70
+
- Rename a variable once in a file, and NES will suggest updating it throughout the file. If you introduce a new name or naming pattern, Copilot suggests updates to subsequent code to match.
71
71
72
72
:::image type="content" source="media/vs-2022/next-edit-suggestions/rename-variable-edits.png" alt-text="Screenshot that shows NES suggesting edits when a variable is renamed":::
73
73
74
-
- Match code style. After copy-pasting some code, NES will suggest how to adjust it to match the current code where the paste happened.
74
+
-Match code style. After you paste some code, NES suggests adjustments to match it with the style of the surrounding code.
0 commit comments