नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
The Next Edit Suggestions (NES) feature of GitHub Copilot uses your recent edits to anticipate the next edit that you might want to make, and the location of that edit. With this capability, Copilot suggests revisions to your code and comments.
Inline completions are great at autocompleting a section of code. NES helps you stay in the logical edit flow by suggesting changes that are relevant to your current work. You can use the Tab key to quickly move through and accept suggestions. Suggestions might span one or more lines, depending on the scope of the potential change.
Prerequisites
Next Edit Suggestions for GitHub Copilot in SSMS supports the Transact-SQL (T-SQL) language.
Install SSMS 22.2 or later with the AI Assistance workload.
Sign in to your GitHub account with Copilot access.
Use GitHub Copilot for free. Sign up and use AI to code faster and more efficiently.
Enable Next Edit Suggestions
To get started with GitHub Copilot NES, enable the feature in Tools > Options > All Settings > Text Editor > Code Completions > General. Select Copilot Next Edit Suggestions (Next-edit predictions from Copilot) in the Code Completions Providers section.
Start using Next Edit Suggestions
With Copilot Next Edit Suggestions (Next-edit predictions from Copilot) enabled, start writing T-SQL to see suggestions from NES. When the feature suggests a code edit, you can move to it by using the Tab key, and then accept it by using 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.
Understand use cases
NES is helpful in various scenarios by suggesting not only obvious repetitive changes, but also logical changes.
Catch and correct mistakes
NES helps with mistakes like typos. For example, it catches errors if you write SELCT instead of SELECT.
Match a change in intent
NES suggests changes to the rest of your code that match a change in intent. For example, if you update a query and add an alias for a table, NES shows suggestions that use the new alias.
Refactor
If you rename an object or variable once in a file, NES suggests updating it throughout the file. If you introduce a new name or naming pattern, the feature suggests updates to subsequent code to match.
Hide NES
You can hide suggestions from NES in SSMS and review them only when you choose.
In Tools > Options > All Settings > Text Editor > Code Completions > General > Copilot Completions Model, select Collapse Next Edit Suggestions. Your edits still trigger NES, but when a suggestion is available, only the margin indicator appears in the gutter. This indicator points to the relevant line. The suggestion itself remains hidden until you choose to view it.
To view a hidden suggestion, select the margin indicator or the Tab key and the suggestion appears. You can select the Tab key again to accept the suggestion or select the Esc key to dismiss it. After you accept a suggestion, any related suggestions appear automatically. Unrelated new suggestions remain hidden until you choose to view them.