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 for Converge360.

comments powered by Disqus

Featured

  • Full Stack Hands-On Development with .NET

    In the fast-paced realm of modern software development, proficiency across a full stack of technologies is not just beneficial, it's essential. Microsoft has an entire stack of open source development components in its .NET platform (formerly known as .NET Core) that can be used to build an end-to-end set of applications.

  • .NET-Centric Uno Platform Debuts 'Single Project' for 9 Targets

    "We've reduced the complexity of project files and eliminated the need for explicit NuGet package references, separate project libraries, or 'shared' projects."

  • Creating Reactive Applications in .NET

    In modern applications, data is being retrieved in asynchronous, real-time streams, as traditional pull requests where the clients asks for data from the server are becoming a thing of the past.

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

Subscribe on YouTube