November 12th, 2018

AI-assisted Coding Comes to Java in Visual Studio IntelliCode

Xiaokai He
Senior Program Manager

Visual Studio IntelliCode is a set of AI-assisted capabilities that aims to improve developer productivity with features like AI-assisted IntelliSense and statement completion, code formatting, and style rule inference. During SpringOne 2018, we announced that we will bring those productivity boosters to Java developers and now we’re happy to introduce AI-assisted IntelliSense to Java in the IntelliCode Extension for Visual Studio Code.

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.

Check out the animation below to see IntelliCode for Java in action.

IntelliCode for Java

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.

Exploring and managing your Java project

You speak, we listen. Some of the most frequent feedback requests we received from developers on Visual Studio Code are the lack of a package view, dependency management and project creation. Thus, we’ve built a new extension to provide those features – Java Dependencies.

See below for package and dependency view.

Package and Dependency Viewer

And create a simple Java project.

Create Java project

Spring Tool 4 available for Visual Studio Code

During SpringOne 2018, Pivotal announced the release of their brand new Spring Tool 4 built on top of the Language Server Protocol developed by Visual Studio Code team, and it’s now available for Visual Studio Code, Eclipse and Atom. Pivotal and Microsoft presented sessions to promote that during both SpringOne and Oracle Code One.

Along with Spring Initializr and Spring Boot Dashboard, now you can easily create new Spring Boot applications, navigate your source code, have smart code editing, see runtime live information in your editor and manage your running application, all within Visual Studio Code.

Spring Tools 4

View the recording of Hacking Spring Boot Applications Using Visual Studio Code to learn more.

More improvements for Java in Visual Studio Code

There’s also lots of additional new features added to our Java on Visual Studio Code extension lineup, including

Debugger for Java

  1. Use code lens to run Java program in a much simpler way.
  2. Add support for Logpoints.
  3. Add a troubleshooting page for common errors.
  4. Support starting without debugging.
  5. Add new user settings java.debug.settings.enableRunDebugCodeLens to enable/disable Run|Debug Code Lenses on main methods #464 (Thank you Thad House!)
  6. Add Italian translation for extension configuration #463 (Thank you Julien Russo!)

Tomcat

  1. Support right click on exploded WAR folder to run it directory Tomcat Server
  2. Support right click on exploded WAR folder to debug it directory on Tomcat Server
  3. Add command “Generate WAR Package from Current Folder”

Maven

  1. Supported to fast re-run maven command from history. Added entry for historical commands in context menu.
  2. Supported to trigger maven command from command palette.
  3. Supported to hide Maven explorer view by default.
  4. Started to use a separate terminal for each root folder.
  5. Supported to update explorer automatically when workspace folders change.

With the help from Language Support for Java by Red Hat, we now have better support for newer versions of Java (9, 10, and 11), better integrations with the editor (outline, go to implementation), more code actions (convert var to type and vice versa, convert to lambda expression) and various other enhancements.

Provide feedback

Your feedback and suggestions are especially important to us and will help shape our products in future. Please help us by taking this survey to share your thoughts!

Try it out

Please don’t hesitate to have a try on using Visual Studio Code for your Java development and let us know your feelings! Visual Studio Code is a lightweight and performant code editor with great Java support especially for building microservices.

Install the Java Extension Pack which including Language Support for Java™ by Red Hat, Debugger for Java, Maven and Java Test Runner.

Author

Xiaokai He
Senior Program Manager

Xiaokai is the program manager working on Java developer tools and services at Microsoft. He’s currently focusing on making Visual Studio Code great for Java developers, as well as supporting Java in various of cloud services in Azure.

0 comments

Discussion are closed.