{"id":226411,"date":"2019-09-16T09:30:23","date_gmt":"2019-09-16T16:30:23","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/visualstudio\/?p=226411"},"modified":"2019-11-14T15:05:28","modified_gmt":"2019-11-14T23:05:28","slug":"java-on-visual-studio-code-september-update","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/java\/java-on-visual-studio-code-september-update\/","title":{"rendered":"Java on Visual Studio Code September Update"},"content":{"rendered":"<p>Welcome to the September update of Java on Visual Studio Code!<\/p>\n<p>There&#8217;re a lot we&#8217;ve been working on during the summer which we&#8217;d like to share with you now. You will see new refactoring and code action features such as move member and class, live linting as well as improvements for Debugger, Test Runner and Maven. We&#8217;ve also improved getting started experience with our new Pack release.<\/p>\n<h3>Refactoring and Code Actions<\/h3>\n<h5>Move refactoring support<\/h5>\n<p>The <strong>Move<\/strong> refactoring lets you move packages and classes between the source roots of a project, class members to other classes and inner classes to upper hierarchy levels.<\/p>\n<p>For example, you can perform the <strong>move<\/strong> refactoring on <em>static method<\/em>\u00a0if it is used more in another class than in its own class.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-226449\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/09\/move-static-member.gif\" alt=\"\" width=\"1024\" height=\"768\" \/><\/p>\n<p>You can also <strong>move<\/strong> a class to another package.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-226448\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/09\/move-file.gif\" alt=\"\" width=\"1024\" height=\"768\" \/><\/p>\n<p>And <strong>move<\/strong> inner class to new a new file.<\/p>\n<h5><img decoding=\"async\" class=\"alignnone size-full wp-image-226447\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/09\/move-inner-type.gif\" alt=\"\" width=\"1024\" height=\"768\" \/><\/h5>\n<h5>Other new code actions<\/h5>\n<p>A couple of other code actions and quick fixes are also included in the latest release<\/p>\n<ol>\n<li><strong>Invert local variable<\/strong> lets you change the sense of a Boolean variable to the opposite one.<\/li>\n<li><strong>Convert lambda to anonymous class<\/strong> (as we already support Convert to lambda expression).<\/li>\n<li><strong>Create unresolved types<\/strong> which covers create simple class\/enum\/interface\/annotation in various scenarios.<\/li>\n<\/ol>\n<h3>Linting and Checkstyle<\/h3>\n<div class=\"css-1dbjc4n r-xoduu5\">We<span class=\"css-901oao css-16my406 r-1qd0xha r-ad9z0x r-bcqeeo r-qvutc0\"> now support Live Linting and batch check for Java through <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=shengchen.vscode-checkstyle\">Checkstyle<\/a> extension<\/span><span class=\"css-901oao css-16my406 r-1qd0xha r-ad9z0x r-bcqeeo r-qvutc0\"> so you no longer need to save the file one by one to update the check result.\u00a0<\/span><\/div>\n<div><\/div>\n<p>See live linting in action.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-226429\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/09\/LiveLinting.gif\" alt=\"\" width=\"1024\" height=\"768\" \/><\/p>\n<p>And batch check is now also available.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-226430\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/09\/batchcheck.gif\" alt=\"\" width=\"1024\" height=\"768\" \/><\/p>\n<p>Other improvements in <span class=\"css-901oao css-16my406 r-1qd0xha r-ad9z0x r-bcqeeo r-qvutc0\"><a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=shengchen.vscode-checkstyle\">Checkstyle<\/a> extension include<\/span><\/p>\n<ol>\n<li>Open problems panel when click the status icon in the status bar<\/li>\n<li>Automatically detect potential Checkstyle configuration files when using command to set the configuration<\/li>\n<\/ol>\n<h3>Debugger<\/h3>\n<p>One of the changes we&#8217;ve recently made is to use integrated terminal as default debug console. With this change, you no longer need to make specific configuration to allow the console to accept your input. The only drawback of this change is the integrated terminal doesn&#8217;t support expression evaluation. In order to use this feature, you would now need to change the console to use the Internal Console in <code>launch.json<\/code>.<\/p>\n<pre class=\"lang:default decode:true \">\"console\": \"internalConsole\"<\/pre>\n<div>\n<div>If you&#8217;d like to use that setting each time you launch a Java program, you can configure it as a global user setting with <code>java.debug.settings.console<\/code>.<\/div>\n<\/div>\n<div><\/div>\n<div>In order to make run and debug even easier, another change we&#8217;ve made is to add\u00a0menu entries to <strong>Run <\/strong>and <strong>Debug<\/strong> a Java application when you right click a Java file in file explorer or opened editor.<\/div>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-226431\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/09\/DebugContextMenu.png\" alt=\"\" width=\"446\" height=\"227\" \/><\/p>\n<h3>Test Runner<\/h3>\n<p>More JUnit 5 annotations are now supported by VS Code Java Test Runner.<\/p>\n<p>Support JUnit 5 meta-annotations and composed annotations.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-226433\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/09\/meta-annotation.gif\" alt=\"\" width=\"1530\" height=\"768\" \/><\/p>\n<p>Support JUnit 5 @TestTemplate.<\/p>\n<h3><img decoding=\"async\" class=\"alignnone size-full wp-image-226434\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/09\/test-template.gif\" alt=\"\" width=\"1024\" height=\"768\" \/><\/h3>\n<h3>Getting Started Experience<\/h3>\n<p>For developers new to Java or new to VS Code, we&#8217;re now providing a refreshed Getting Started experience. Once you&#8217;ve installed the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=vscjava.vscode-java-pack\">Java Extension Pack<\/a>, you can use the command <strong>Java: Getting Started<\/strong> to get the quick start guide.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-226436\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/09\/GettingStarted.png\" alt=\"\" width=\"1358\" height=\"1231\" \/><\/p>\n<p>The new <strong>Getting Started<\/strong> view provides a quick start guide as well as tips for code editing and debugging. It also has an FAQ to answer some of the most asked questions. We plan to add more section to it in future.<\/p>\n<p>One of the other hurdle for new Java developer is to get the JDK right. For that, we&#8217;ve also upgraded our <strong>Configure Java Runtime<\/strong> page which now shows the JDK configuration we detect with priority order and allow you to jump to the setting by a simple click. If a working JDK configuration is not detected, this page will be presented automatically, otherwise you can also use the command <strong>Java: Configure Java Runtime<\/strong> to get there.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-226437\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/09\/JDK.png\" alt=\"\" width=\"1363\" height=\"971\" \/><\/p>\n<p>With those new features, we&#8217;ve also released our new version of VS Code Installer for Java. You can try it at <a href=\"https:\/\/aka.ms\/vscode-java-installer-win\">https:\/\/aka.ms\/vscode-java-installer-win<\/a>\u00a0with improved downloading and installation experience.<\/p>\n<h3>External contributions<\/h3>\n<p>As VS Code becomes popular among Java developers, we&#8217;re getting more and more issues reported. They&#8217;re very helpful and please keep them coming! In addition, we&#8217;d like to express our gratitude for those from the community who spend more time with us to make the product even better.<\/p>\n<ul>\n<li>Contribution from <a href=\"https:\/\/github.com\/pi1024e\">pi1024e<\/a>: User face change: say &#8220;Do not show again&#8221; instead of &#8220;Not show again&#8221;. https:\/\/github.com\/microsoft\/vscode-java-debug\/pull\/630<\/li>\n<li>Contribution from Christian Lutz <a href=\"https:\/\/github.com\/thccorni\">thccorni<\/a>: Typo &#8216;gourpId&#8217; in hoverProvider. https:\/\/github.com\/microsoft\/vscode-maven\/issues\/368<\/li>\n<\/ul>\n<p>There&#8217;re also a few pull requests from community currently under review. We&#8217;d like to thank all of you to help us build better tool for the Java community.<\/p>\n<h3 id=\"signup\">Sign up<\/h3>\n<p>If you&#8217;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.<\/p>\n<div data-form-block-id=\"a98bf458-e066-e911-a96e-000d3a340154\"><\/div>\n<p><script src=\"https:\/\/mktdplp102cdn.azureedge.net\/public\/1.35.1026.0\/static\/js\/form-loader.js\"><\/script><\/p>\n<div id=\"dgCPdzqBMykwIL6XsCcP3tC9zZGvAAN-t3ma0GiZE0QU\"><\/div>\n<p><script language=\"javascript\" type=\"text\/javascript\">(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', 'https:\/\/5a3318f6fcc34e41bf99d46845944055.svc.dynamics.com\/f', 'https:\/\/5a3318f6fcc34e41bf99d46845944055.svc.dynamics.com\/t', 'https:\/\/5a3318f6fcc34e41bf99d46845944055.svc.dynamics.com\/t\/w', typeof ms_tr_il_08 === \"undefined\" ? null : ms_tr_il_08, typeof ms_tr_il_w_01 === \"undefined\" ? null : ms_tr_il_w_01);<\/script><\/p>\n<h3>Try it out<\/h3>\n<p>Please don\u2019t hesitate to give it a try! Your feedback and suggestions are very important to us and will help shape our product in future.<\/p>\n<ul>\n<li>Learn more about <a href=\"https:\/\/code.visualstudio.com\/docs\/languages\/java\" target=\"_blank\" rel=\"noopener noreferrer\">Java on Visual Studio Code<\/a>.<\/li>\n<li>Explore our step by step <a href=\"https:\/\/code.visualstudio.com\/docs\/java\/java-tutorial\" target=\"_blank\" rel=\"noopener noreferrer\">Java Tutorials on Visual Studio Code<\/a>.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>September update for Java on Visual Studio Code. Including move refactoring, more code actions, live linting, new getting started experience and more updates for debugger and test runner extensions.<\/p>\n","protected":false},"author":668,"featured_media":226924,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[8,15],"tags":[25,30,31,27,28],"class_list":["post-226411","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-open-source","category-vscode","tag-debugging","tag-get-started","tag-linting","tag-refactoring","tag-testing"],"acf":[],"blog_post_summary":"<p>September update for Java on Visual Studio Code. Including move refactoring, more code actions, live linting, new getting started experience and more updates for debugger and test runner extensions.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/226411","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/users\/668"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/comments?post=226411"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/226411\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media\/226924"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media?parent=226411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/categories?post=226411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/tags?post=226411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}