Type less, code more with IntelliCode completions

Mark Wilson-Thomas

In Visual Studio 2022 Preview 1 you can automatically complete code, up to a whole line at a time!

Check out the video to see what it can do; it shows writing real code from a controller of the ASP.NET eShopOnWeb reference application.

You can try this for yourself right now, on your own C# code!

Rich context gives great completions

IntelliCode now predicts the next chunk of code based on your current context, and presents it as an inline suggestion to the right of your cursor. If you like it, just hit tab-tab to accept it; otherwise simply keep on typing to adjust the completion further.

To achieve this, IntelliCode uses a large scale transformer model, trained on around half a million public open-source repos from GitHub. It combines this with a rich knowledge of your coding context, taking cues from it including:

  • Variable names and positions
  • The sort of code you’re writing (e.g. the libraries you’re using)
  • Functions in nearby code
  • The IntelliSense list – changing your selection in that list steers the model with extra context, so you can easily explore different completions to get to just the code you need

It runs right on your local machine while you’re editing, and covers many programming languages too. For our initial preview release we’re supporting C#, but watch for more languages coming soon!

Let us know what you think!

IntelliCode has benefitted greatly from all the rich feedback we’ve received from you – thank you! We hope you’ll help us continue to improve by giving the newly enhanced completions a try and letting us know what you think.

Please report any issues you see via Developer Community and file feature requests if you have them.