Java on Visual Studio Code Update – May 2020

This post has been republished via RSS; it originally appeared at: Microsoft Developer Blogs.

Welcome back to the May update of Java on Visual Studio Code. Your satisfaction continuously motivates us delivering the best product for you. Therefore, whatever it is a new feature or an enhancement, we hope you like it. In this update, we will show enhancements on Java side that make the product more friendly and also answer a frequently asked question. On to the update. Display Java language level on status bar As Java evolves, developers need deal with language level. Today, VS Code applies language level for your project based on project setting. As an enhancement, now VS Code's status bar displays the language level directly, so no need open your project file to look for it anymore. When you click the language level on status bar, it will take you to “java.configuration.runtimes” setting, where you can configure your JDK settings. To get the benefit of this enhancement, you need the latest version of Language Support for Java extension and set active editor tab to a “.java” file. Refactor package name Renaming a folder in the explorer view now triggers package refactoring. At the 1st time, you'll be prompted to select either always automatically apply or always preview before apply: The behavior is controlled by “java.refactor.renameFromFileExplorer” in your preference setting with below options: never: Don't enable refactoring for rename operations on File Explorer. autoApply: Always automatically update the imports and package declarations. preview: Always preview the changes before applying. prompt: Ask user to confirm whether to bypass refactor preview. Attach debugger by process ID Debugger extension now supports Attach by Process ID. To work with this new capability, you need the latest version of debugger extension, and add a debugger configuration with “java: Attach to Process” option. When run debugger, you will be promoted to pick a debugging process to attach. Other enhancements Command “Create Java Project” now allows you to select creating a Java project with Maven support (as long as the Maven extension is installed) or a project without any build tools. A new argument of “sourcePaths” supports specifying source path as part of your customer configuration for running your tests. You can find the argument under “java.test.config” in your preference setting. A new command of "Import Java projects in workspace" allows you to add a module into an opened project without restarting window. FAQ: generate getters & setters in bulk Many users have asked us how to generate getters & setters in bulk. Actually, you can easily find the option of bulk generation under “Source Action” by right-clicking your .Java file. 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. (function (id, f, t, ws, ms_tr_il_08, ms_tr_il_w_01) { var tr = function (cb) { var count = 0; var callback = function () { if (count == 0) { count++; if (w) { w.w(id, t, cb); } } }; var ts = document.createElement('script'); ts.src = ws; ts.type = 'text/javascript'; ts.onload = callback; ts.onreadystatechange = function () { if (this.readyState == 'complete' || this.readyState == 'loaded') { callback(); } }; var head = document.getElementsByTagName('head')[0]; head.appendChild(ts); }; if (typeof ms_tr_il_08 === 'function') { if (ms_tr_il_w_01 === null) { tr(function() { ms_tr_il_08(id, f, t); }); } else { ms_tr_il_w_01.w(id, t, function(websiteVisitedParams) { ms_tr_il_08(id, f, t, websiteVisitedParams); }); } } else { tr(); }})('gCPdzqBMykwIL6XsCcP3tC9zZGvAAN-t3ma0GiZE0QU', '', '', '', typeof ms_tr_il_08 === "undefined" ? null : ms_tr_il_08, typeof ms_tr_il_w_01 === "undefined" ? null : ms_tr_il_w_01); 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. Learn more about Java on Visual Studio Code. Explore our step by step Java Tutorials on Visual Studio Code.

REMEMBER: these articles are REPUBLISHED. Your best bet to get a reply is to follow the link at the top of the post to the ORIGINAL post! BUT you're more than welcome to start discussions here:

This site uses Akismet to reduce spam. Learn how your comment data is processed.