How to use Visual Studio IntelliCode – Code Development using AI
Visual Studio IntelliCode is a tool helping in code development and analysis of code using Artificial intelligence.
This tool provides contextual recommendations for code completion as you type your code.
As per Microsoft, these contextual recommendations are provided based on best practices that are developed using AI by verifying thousands of high-quality, open-source projects on GitHub plus these tools also help to analyze your codebase and train itself to provide a project-specific recommendation.
This tool is currently available through Visual Studio Marketplace as an extension. This is one of the good to have an extension on the developer’s machine.
Today in this article, we will cover below aspects,
Main Features
- Improve developer productivity using AI.
- Help following the code and style patterns. Patterns get created from your code base itself.
- All suggestions are provided using the existing code context.
- Code review support by highlighting the code changes which require more attention.
- AI-assisted IntelliSense context-aware code completions, signature tool-tips, and help instead of traditional IntelliSense support.
Language Support
- Visual Studio: C#, C++, and XAML
- Visual Studio Code: Java, JavaScript, Python, and TypeScript
Getting Started
Prerequisites :
- Latest version of VS2017 (15.8 and above)
- Latest version of VSCode(1.29.1 and above)
Steps for configuring Visual Studio IntelliCode
- Install Intellicode from Marketplace or from VS Extension as below,
Marketplace: https://visualstudio.microsoft.com/services/intellicode/
VS Tools extension:
- The first-time installation requires you to restart Visual Studio 2017 to process installation.
- After successful installation lets open your project solution.Got to View->Other Windows->Intellicode
- Click on Train my code
- After training of model completes status will be updated as complete.
Lets see the result of code recommendation before Intellicode and after Intellicode as shown below,
As shown above, your IntelliSense support now uses more common sense using AI model and provide you specific code completion recommendation.
If you are interested to see generated model on your desktop Open file location %TEMP%\Visual Studio IntelliCode
The above folder contains the model (not the code) data that is sent to Microsoft over HTTPS.
Useful References
That’s all! Happy coding!
Does this help you fix your issue?
Do you have any better solutions or suggestions? Please sound off your comments below.
Please bookmark this page and share it with your friends. Please Subscribe to the blog to receive notifications on freshly published(2024) best practices and guidelines for software design and development.
Hello- I wanted to use this AI feature, had to struggle for my visual studio as I was using lower version. I wish I could visit this post early.As you stated prerequisites, this feature is supported lower version
Hi eleen- Thanks for your thoughts. I appreciate that. Yes, this feature is not supported in the lower VS version. You need a minimum VS2017 15.8 and above.
Can we use Vs2017 version to work with Intellicode ??
Hi Nitin, Yes you can use VS2017 version 15.8 and above to work with Intellicode. Thanks for reading and your question.