Code more, scroll less with Visual Studio IntelliCode

Mark Wilson-Thomas

You may know that Visual Studio IntelliCode helps you write code from commonly used libraries, based on machine learning across thousands of open sourced GitHub repos. Instead of having to search and scroll through a sorted list of methods and properties, you get suggestions on the most likely ones for your coding context as you type.

While the wisdom of the open source community is delivered direct to your editor’s IntelliSense, what if you want to write code based on a set of APIs not included in the GitHub public repos? Perhaps you use numerous internal utility and base class libraries, or domain-specific libraries that aren’t often used in open-source.  You may not know that if you code in C# you can have IntelliCode analyze to your own code and share what it learns it across your team, so you can all benefit from recommendations and more easily collaborate. Depending on your codebase, analyzing your code and sharing the resulting model could be done in a matter of minutes and save your team hours of hunting through lists and documentation diving.

How do I create and use my own model?

It’s as easy as 3 short steps.

  1. Make sure you have the IntelliCode extension for Visual Studio installed
  2. Effortlessly create a custom model for a codebase that contains good examples of usage of your desired class libraries – remember that the quality of suggestions offered by IntelliCode is directly related to the quality of the samples you provide.
  3. Easily share it with your colleagues so they can start using the recommendations. If you need to update the model, for instance if there are substantial changes to the code, your team will automatically receive the latest updates when you retrain.

Creating an IntelliCode Custom Model

My colleague Allison Buchholtz-Au has a great video covering this topic if you’d like to see more details.

If you’re a contributing author of an open source component, it’s simple for you to share a model that helps your users leverage your libraries more easily. Don’t forget to share the model somewhere that users who are getting started will find it. We suggest linking to it from the README in your repo.

What about security?

Most importantly, we don’t upload your raw source code to our servers. You can learn more about what happens when you train a model in our FAQ.

Your feedback matters

If you have more suggestions and feedback about IntelliCode, we’d love to hear from you. Get in touch and let us know more.