Microsoft Brings AI to Visual Studio with IntelliCode
Artificial intelligence was the dominant theme of today's Microsoft Build conference, and of special interest to Visual Studio coders is AI-assisted development via IntelliCode.
Still in preview and provided by a Visual Studio experimental extension in the Visual Studio Marketplace, Visual Studio IntelliCode, builds upon the existing IntelliSense functionality to provide even more intelligent code suggestions.
IntelliSense, of course, provides autocomplete suggestions for options you're likely to want once you start keyboarding in a variable, function name and so on. Leveraging the vast repository of code parked on GitHub, Visual Studio is said to now make smarter suggestions, going beyond options ordered alphabetically or by most recent usage by incorporating context-awareness.
"IntelliCode saves time by putting what you’re most likely to use at the top of your completion list," its site says. IntelliCode’s recommendations are based on 2,000 high-quality open source projects on GitHub -- each with over 100 stars -- so it’s trained on best practices. When combined with the context of your code, the completion list is tailored to promote those practices."
Specifically, Microsoft said it:
- Delivers context-aware code completions
- Guides developers to adhere to the patterns and styles of their team
- Finds difficult-to-catch code issues
- Focuses code reviews by drawing attention to areas that really matter
With the AI-assisted context-awareness, it can also serve as a learning tool, Microsoft said.
"As you type, AI-assisted IntelliSense recommends the most likely API," Microsoft said in an announcement blog post on the opening day of Build. "This makes it easier to learn a new API and dramatically reduces the number of keystrokes required to complete a line. With more context from the code you write, IntelliSense becomes more accurate.
"IntelliCode’s improvements are not just about statement completion. IntelliCode also provides guidance as to the most appropriate overload for that API given the current code context. No more extraneous scrolling!"
Machine learning is also put to use to analyze source code to ID irregular patterns, missed refactorings, incorrect variable usage and more.
The brand-new technology preview from Microsoft DevLabs works only with Visual Studio 15.7 -- which itself came out of preview only today -- and for now works only with C#, though support for other languages is planned.
As the project is in an early experimental stage, Microsoft invited developers to sign up for news and updates on the project or go ahead and get started with the extension -- which was already downloaded more than 400 time shortly after being announced at the Build conference -- and provide feedback via its built-in Report a Problem option.
More hands-on info for IntelliCode is provided in this video.
About the Author
David Ramel is an editor and writer for Converge360.