News

Java Gets AI-Assisted IntelliCode in Visual Studio Code Editor

Java developers using the Visual Studio Code editor can now enjoy the same AI-assisted IntelliCode functionality previously available only to Python coders.

Microsoft's Visual Studio IntelliCode in the Visual Studio Code Marketplace improves upon the legacy IntelliSense functionality through the use of machine learning that allows for understanding coding context.

Through the more thorough understanding of a project's existing code, the tool displays recommended completion items for an application's code context at the top of IntelliSense code completions lists.

By using an advanced inference capability, IntelliCode predicts what a programmer is aiming for as a line of code is typed in, presenting the most likely code completion options at the top of its suggestion list, marked by stars. Previously, with IntelliSense, a wide range of options would be presented, requiring manual winnowing down to find the desired choice.

After being introduced earlier this year, IntelliCode -- still in preview -- was made available to Python developers in July.

IntelliCode for Java in Animated Action
[Click on image for larger view.] IntelliCode for Java in Animated Action (source: Microsoft).

In addition to providing the most likely code completion items based on code context, Microsoft in July also announced IntelliCode had gotten even smarter, gaining the ability to infer coding conventions by scanning existing code and letting developers know when new code violates those conventions.

Going even further, Microsoft's Amanda Silver said IntelliCode can detect new issues and even improve the code review process in a September Visual Studio Live! keynote address.

"We also have the ability to detect new issues, new classes of issues in your code that were previously undetectable by static analysis, based on machine learning algorithms that we've come up with," Silver explained. The service examines both large Microsoft code repositories and public repositories to find new classes of errors that compilers and static analyzers can't detect.

It was the code-completion functionality, however, that was highlighted by Microsoft in a blog post announcing the Java support.

"IntelliCode saves you time by putting the most relevant suggestions at the top of your completion list. IntelliCode recommendations are based on thousands of open source projects on GitHub, each with over 100 stars, so it's trained on most popular usage patterns and practices. When combined with the context of your code, the completion list is tailored to promote those practices," Microsoft said.

"You may have noticed that IntelliCode provides most relevant IntelliSense recommendations based on your current code context, especially within conditional blocks. IntelliCode works well with popular Java libraries and frameworks like Java SE platform and Spring framework. It will help you whether you are doing monolithic or modern microservices architecture."

Yesterday's post also details several other improvements to Java programming in VS Code, including:

  • Easier exploration and management of Java projects through a Java Dependencies extension.
  • The availability of Spring Tools 4 from Pivotal, which leverages the Language Server Protocol created by Visual Studio Code team. When used with other existing tools, it can help developers:
    • Easily create new Spring Boot applications.
    • Navigate source code.
    • Enjoy "smart code editing."
    • See runtime live information in the editor.
    • Manage running applications.
  • More VS Code Java improvements via extensions affecting:

In yesterday's post, Xiaokai He, program manager, details how to try out all the enhancements using the Java Extension Pack, which includes Language Support for Java by Red Hat, Debugger for Java, Maven and Java Test Runner.

The Visual Studio IntelliCode preview extension has been downloaded more than 362,000 times.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube