Frictionless repeated edits: IntelliCode suggestions in completion list
As a developer you make repetitive changes to your code all the time. In many cases you don’t even realize that you are doing a repetitive task or that Visual Studio IntelliCode suggestions can help you. IntelliCode suggestions can already do the edit and find other locations where the same edit applies, making your life easier! But now, in Visual Studio 16.9 you can easily apply suggestions in a frictionless way all without breaking your editing flow. You can find IntelliCode suggestions right in your IntelliSense completion list, and can find and apply the same change at other locations.
Completion list: how it works:
IntelliCode suggestions in the completion list blends naturally into your editing flow. The edit is added to the completion list in a non intrusive way. Now it is easy to find, and non-intrusively perform the repeated action. You can recognize the suggestion is coming from IntelliCode by the icon and star.
Follow-up after apply
After you have applied an IntelliCode suggestion, if there are more locations the same edit would apply, IntelliCode shows a lightbulb to help you follow up. The lightbulb has actions to enable you to do the same edit at other locations.
How it works
Under the hood, IntelliCode looks at each of your edits as you type. Using PROSE (PROgram Synthesis by Example), IntelliCode synthesizes generalized edit scripts that take your code from the “before editing” state to the “after”. The underlying technology is like the Excel’s Flash Fill feature and is described in this research paper.
New in preview: key bindings
Many of you prefer to work from the keyboard. IntelliCode suggestions now has key bindings for all the common actions in preview. Ctrl+Alt-. to apply directly, Ctrl+Alt-, to go to the next suggestion and Ctrl+Alt+/ will toggle an inline preview if there is a suggestion on the current line.
You can help us to perfect the key bindings preview feature – enable it in Visual Studio 16.9 by setting Options->IntelliCode->Preview section-> Suggestions key bindings to Enabled, try it out and send us feedback!
Putting it all together
Check out the video below to see how this works end-to-end: