Frictionless repeated edits: IntelliCode suggestions in completion list

Peter Groenewegen

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:

Apply an IntelliCode suggestion from the completion list. Start typing, select the suggestion from the completion list, see preview and than apply the edit.

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.

Use lightbulb action after an suggestion was applied

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.

Apply IntelliCode suggestions with key binding and go to next with key binding

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:

Let us know what you think!

We really like the detailed feedback we are getting from you! It helps us to prioritize the features we are working on and improve the experience. In the Visual Studio preview you can find even more future features we are working on with key bindings. Note that although IntelliCode is aware of the semantic structure of your code, sometimes suggestions do not match your intent. In these cases, please do let us know what you expected; it will help us provide better suggestions in the future. Please raise any issues via Visual Studio “report a problem”.


Discussion is closed. Login to edit/delete existing comments.

  • anonymous 0

    this comment has been deleted.

    • Peter GroenewegenMicrosoft employee 0

      Thanks for the feedback, from usage numbers we know it is especially useful for language constructs. Imagine in you are changing a property or number of parameters of a method. You probably use the construct multiple times in your code at different locations. After doing the change twice we help you at the next locations. By looking at the changes you do to the syntax tree we can predict the probably changes you are about to make.

      We would love to hear feedback on how we can improve IntelliSense further for you as well, feel free to reach out to me directly at pegroene at microsoft dot com.


    • anonymous 0

      this comment has been deleted.

  • anonymous 0

    this comment has been deleted.

    • Jorge Morales Vidal 0

      I have seen options for IntelliCode in C++, you can check those out by going to Options > IntelliCode > General. Ensure that you have the most recent version of Visual Studio 2019 installed.

      • Peter GroenewegenMicrosoft employee 0

        Thank you for the feedback, IntelliCode suggestions is currently not available for C++. We have other languages under consideration and noted your comment. For C++ we offer currently IntelliCode IntelliSense completions based on common usage and you can train models on your own code base.

Feedback usabilla icon