What’s new in Visual Studio IntelliCode

Introduction
Custom Models
Additional language support
Demo in Visual Studio Code
Conclusion

Introduction

Visual Studio IntelliCode is a set of AI-assisted capabilities for Visual Studio to help make developers more productive. In this post I am going to show the latest and greatest in Visual Studio Intelli code, which is custom models and additional language support.

Custom models

Custom models will provide suggestions based of your code. The current model only provides suggestions for common types, like strings or date/time things that are commonly found in the open source community. But now the classes that you use in your private code repositories will have AI-assisted intelligence suggestions. What is even better, is that once you train a custom model, you can go ahead and share that model with your teammates. They don’t need to go to the same training process that you have already done.
How to get this custom models? In order to open the Intelli code window, click on the View menu, then choose Other windows, and click on the Intelli Code. In the Intelli Code page, you will see the solution name and status of our model. In order to start the process, click on the “Train on my code” button, displayed on the image 1.

Image 1 - Train on my code

Image 1 – Train on my code

 

TipYou can find more information about DevOps in the following post: DevOps: The Three Stage Conversation – People, Process, Products which describes the basic principles of DevOps. This post will be especially helpful to those for whom DevOps is still a new concept. If you prefer a deeper view on this topic, have a look at the following guide: quick guide about Basic Principles of DevOps, which presents an overview of DevOps process and practices, describing “the big picture”, while still maintaining the high level of detail.

 

You will see the status page, with three possible statuses:

  • analyzing your code – happens all client-side, extracting all important information about your source code in order to feed into our model service;
  • uploading your data – upload all information to the service in the cloud;
  • learning your codes pattern (which is where actually the model is created) – after the model is generated, it is sent back down to visual studio to give you those starred recommendations of your custom types and classes;

After the model is quickly trained, We will see a new page which is all about our active trained model, displayed on image 2.

Image 2 - Active model

Image 2 – Active model

On this page is displayed the time and date that it was trained, as well as its status, which is that it is ready to be used. In addition, you have the ability to share it, as well as to delete it if you do not want to use it anymore. If your code changes drastically, from when you first created the model, you can retrain it. Also the model details are displayed, with details about how much classes the model covers, and also recommendations.

 

 

More InfoIf you would like to learn more about what is the story behind containers and what drives or the needs for it, we will know why companies moved from traditional solution architecture to Microservices and how this put containers as the perfect solution for running them, we will get quick intro to clear some definitions, tools and keywords related to this ecosystem, for example, we will understand what is the different between VM, Container and Hyper-V Container, why we would prefer container over VM and when the VM is better, we will understand the different between container and image and know the life cycle of creating a new image and why I do that, like adding more layers to the base image, push that to container images registry on the cloud, then pull that from the registry to anywhere to have a new container. We will understand also different technologies and services around container, like Docker, Docker Swarm, Kubernetes, Azure Container Services (ACS), Azure Container Registry, etc.- have a look at this post – have a look at the this post

 

Additional language support

  • Visual Studio
    • XAML
    • C++
  • Visual Studio Code
    • JavaScript/TypeScript
    • Java

Demo in Visual Studio Code

In the Visual Studio Code we can see there are two files opened, a Java file (image 3) and a Python file (image 4), which only has a message in it to start.

Image 3 - Java file

Image 3 – Java file

Image 4 - Python file

Image 4 – Python file

We are going to see that the AI-assisted intellisense is going to work seamlessly as I move between the Java file and the Python file. In the Java file, we have a simple message string. If you type “msg.” , you will get AI-assisted intellisense suggestions (image 5).

 

Image 5 - AI-assisted suggestions - java

Image 5 – AI-assisted suggestions – java

If you move over to the Python file, just by clicking on the file (no extra setup), and activate AI-assisted intellisense, you will notice that Python intellisense works seamlessly, without messing with the language server (image 6).

 

Image 6 - AI-assisted suggestions - python

Image 6 – AI-assisted suggestions – python

Conclusion

IntelliCode saves you time by putting what you’re most likely to use at the top of your completion list. IntelliCode recommendations are based on thousands of open source projects on GitHub each with over 100 stars. When combined with the context of your code, the completion list is tailored to promote common practices.

Share This: