Java on Visual Studio Code July Update

Xiaokai He

Welcome to the July update of Java on Visual Studio Code!

In this update, we’d like to share a couple new refactoring features, semantic selection as well as some other enhancements we delivered during last few weeks.

Refactoring

Trigger rename after extract to variable/constant/method

After performing extract to variable/constant/method refactoring, more often than not, we would like to assign the result with a meaningful name. With this feature, you won’t need to perform a separate rename action anymore, all are streamlined in the single refactoring step.

Convert a local variable to a field.

Extract to field is also a very popular refactor. When selecting an expression, you can now use extract to field.

When selecting a variable declaration, it willconvert the variable to field.

Support for semantic selection

Smart Selection (a.k.a. Semantic Selection) is the new feature added by VS Code and now it understands Java code as well. With that, you are able to expand or shrink the selection range corresponding to the semantic info of the caret position in your code.

  • To expand the selection, use `Shift + Alt + →`  on Windows, and `Ctrl + Shift + Command + →` on Mac
  • To shrink the selection, use `Shift + Alt + ←` on Windows and `Ctrl + Shift + Command + ←` on Mac

Other enhancements

Maven
  • Maven projects use the latest Execution Environment when source/target is not yet supported.
  • For users who don’t have Maven installed locally, mvn can not be found to create a Maven project from archetypes. Maven extension now embeds a global maven wrapper in the extension, which serves as a fallback if no mvn or project-level mvnw found.
  • Support to select archetype version during Maven project creation.
  • Refresh explorer when config maven.pomfile.globPattern changes.
Gradle
  • Added additional Gradle preferences.
    • java.import.gradle.arguments: arguments to pass to Gradle
    • java.import.gradle.jvmArguments: JVM arguments to pass to Gradle
    • java.import.gradle.home: setting for GRADLE_HOME
Checkstyle
  • Support loading CheckStyle Configuration via Http URL.

Sign up

If you’d like to follow the latest of Java on VS Code, please provide your email with us using the form below. We will send out updates and tips every couple weeks and invite you to test our unreleased feature and provide feedback early on.

Try it out

Please don’t hesitate to give it a try! Your feedback and suggestions are very important to us and will help shape our product in future.

0 comments

Discussion is closed.

Feedback usabilla icon