{"id":226761,"date":"2019-10-18T09:00:47","date_gmt":"2019-10-18T16:00:47","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/visualstudio\/?p=226761"},"modified":"2019-11-14T15:03:45","modified_gmt":"2019-11-14T23:03:45","slug":"java-on-visual-studio-code-october-update","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/java\/java-on-visual-studio-code-october-update\/","title":{"rendered":"Java on Visual Studio Code October Update"},"content":{"rendered":"<p>Welcome to the October update of Java on Visual Studio Code! This month, we&#8217;re bringing some new features for code navigation, code actions and refactoring, code snippet along with Java 13 support. There&#8217;re also improvements in debugger, maven, checkstyle and Test Runner. Please checkout and let us know what you think!<\/p>\n<h3>Code Navigation<\/h3>\n<h5>Go to super implementation<\/h5>\n<div>\n<div>You can now keep track of class implementations and overriding methods by clicking the <code>Go to Super Implementation<\/code> link when hover.<\/div>\n<div><\/div>\n<\/div>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-226773\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/10\/Go-to-Super-Implementation.png\" alt=\"\" width=\"784\" height=\"275\" \/><\/p>\n<p>See the code navigation in action.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-226811\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/10\/navigateToSuperImplementation.gif\" alt=\"\" width=\"1025\" height=\"768\" \/><\/p>\n<h3>Code Actions<\/h3>\n<p>A couple new code actions have been added to VS Code for Java recently.<\/p>\n<h5>Create non existing package<\/h5>\n<p>Now when your package name doesn&#8217;t match the folder name, you have the options to either change the package name in your code, or move the folder in file system (even when the destination folder doesn&#8217;t exist yet).<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-226815\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/10\/createNonExistingPackage.gif\" alt=\"\" width=\"1024\" height=\"768\" \/><\/p>\n<h5>Add quick fix for non accessible references<\/h5>\n<p>This quick fix helps you resolve non accessible reference<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-226810\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/10\/non-access.gif\" alt=\"\" width=\"1024\" height=\"768\" \/><\/p>\n<h5>Automatically trigger auto-import on paste<\/h5>\n<p>If you paste blocks of code that contain references to classes or static methods and fields that are not yet imported, VS Code now can automatically add missing imports. The new feature is enabled via the\u00a0<code>java.actionsOnPaste.organizeImports<\/code> preference in VS Code preferences. If <code>true<\/code> (the default value), triggers &#8220;Organize imports&#8221; when Java code is pasted into an empty file.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-226847\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/10\/autoImportOnPaste.gif\" alt=\"\" width=\"1024\" height=\"768\" \/><\/p>\n<h3>Refactoring<\/h3>\n<h5>Inline refactoring<\/h5>\n<p>The\u00a0<span class=\"keyword\">Inline<\/span> refactoring lets you reverse the refactoring for a local variable, method, and constant.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-226814\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/10\/Inline.gif\" alt=\"\" width=\"1024\" height=\"768\" \/><\/p>\n<h5>Convert for-loop to for-each loop<\/h5>\n<p>The enhanced for-loop is a popular feature. Its simple structure allows you to simplify code by presenting for-loops that visit each element of an array\/collection without explicitly expressing how one goes from element to element.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-226805\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/10\/for-loop.gif\" alt=\"\" width=\"1024\" height=\"768\" \/><\/p>\n<h5>Convert anonymous class to nested class<\/h5>\n<p>This refactoring allows you to convert an anonymous class into a named inner class.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-226808\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/10\/annonymous.gif\" alt=\"\" width=\"1024\" height=\"768\" \/><\/p>\n<h5 id=\"_deprecation-tags-for-symbols-and-completions\" data-needslink=\"_deprecation-tags-for-symbols-and-completions\">Deprecation tags for symbols and completions<\/h5>\n<p>Java extension now shows source code that references deprecated types or members with a strike-through line.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-226816\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/10\/java-deprecated-method.png\" alt=\"\" width=\"969\" height=\"152\" \/><\/p>\n<h3>Code Snippets<\/h3>\n<p>Now VS Code Java supports server side code snippets, which means it will provide more code snippets options in a context aware way. You can also also see more detailed information during the preview of code snippets during selection.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-226861\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/10\/WeChat-Screenshot_20191016134421-1.png\" alt=\"\" width=\"1024\" height=\"460\" \/><\/p>\n<h3>Java 13 support<\/h3>\n<p><a href=\"http:\/\/jdk.java.net\/13\/\"><span class=\"pl-e\">Java 13<\/span><\/a> is out and VS Code is ready for it. It supports Java 13 through latest <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=redhat.java\"><span class=\"pl-e\">Java Extension<\/span><\/a>. For developers use Java 12 with preview features, you will need to upgrade to JDK 13 to keep working with them.<\/p>\n<h3>Debugger<\/h3>\n<h5>Show Run\/Debug when hover<\/h5>\n<p>In case you don&#8217;t like the Run\/Debug button on the Code Lens of your <code>main<\/code> method, but still want easy access to the functionality, you can now configure to disable the Code Lens but still accessible by hover.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-226813\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/10\/runHover.gif\" alt=\"\" width=\"1024\" height=\"768\" \/><\/p>\n<p>In this release, we&#8217;ve also made a lot of improvements in error handling and message to help user resolve issues during debugging. One example is to add fix suggestions when a build failure occurs when launching the program.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-226824\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/10\/debug-fix.png\" alt=\"\" width=\"451\" height=\"86\" \/><\/p>\n<p>By clicking <code>Fix...<\/code> a list of suggestions would be provided.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-226825\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/10\/fix-suggestions.png\" alt=\"\" width=\"603\" height=\"223\" \/><\/p>\n<p>A more detailed <a href=\"https:\/\/github.com\/Microsoft\/vscode-java-debug\/blob\/master\/Troubleshooting.md\">troubleshooting guide<\/a> is also provided.<\/p>\n<h3>Maven Support<\/h3>\n<h5>Resolve unknown type<\/h5>\n<p>Maven extension now supports searching Maven Central to resolve unknown type in your code. You can achieve this easily by clicking the link in hover.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-226812\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/10\/resolve-unknown-type.gif\" alt=\"\" width=\"1024\" height=\"768\" \/><\/p>\n<p>Other improvements in Maven extension includes<\/p>\n<ol>\n<li>Enable search artifact by groupId and\/or artifactId when auto completing dependency.<\/li>\n<li>Add inline action buttons in Maven explorer. <span style=\"font-size: 1rem;\">Add icons for Maven explorer items.<\/span><\/li>\n<\/ol>\n<h3>Checkstyle<\/h3>\n<h5>Enhanced setting configuration command<\/h5>\n<p><code>Checkstyle: Set the Checkstyle Configuration<\/code> command will now detect potential <code>Checkstyle<\/code> configuration files and list them. You can also provide a configuration file by directly writing a URL in the input box now.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-226770\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/10\/CheckStyle-Configuration.gif\" alt=\"\" width=\"1024\" height=\"768\" \/><\/p>\n<h5>Setting checkstyle version support<\/h5>\n<p>A new command <code>Checkstyle: Set the Checkstyle Version<\/code> is added to the extension. It supports:<\/p>\n<ul>\n<li>List the latest Checkstyle version from main repo.<\/li>\n<li>List all the download versions.<\/li>\n<li>List all the supported versions.<\/li>\n<li>Mark the currently used version with a check symbol.<\/li>\n<\/ul>\n<p>When the version is too high (with breaking changes) for a user defined checkstyle configuration.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-226771\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/10\/CheckStyle-Version-High.gif\" alt=\"\" width=\"1024\" height=\"768\" \/><\/p>\n<p>And when the version is too low (with new features) for <code>google_check.xml<\/code> fetched from checkstyle master branch.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-226772\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/10\/CheckStyle-Version-Low.gif\" alt=\"\" width=\"1024\" height=\"768\" \/><\/p>\n<h3>Other improvements<\/h3>\n<ol>\n<li>Provide more granularity of progress of loading project. We&#8217;re working on making the language server more transparent with what it&#8217;s working on behind the scene.<\/li>\n<li>Test Runner updates<\/li>\n<\/ol>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>Add\u00a0<code>java.test.saveAllBeforeLaunchTest<\/code> setting to specify whether to automatically save the files before launching the tests.<\/li>\n<li>Add\u00a0<code>java.test.forceBuildBeforeLaunchTest<\/code>\u00a0setting to specify whether to automatically build the workspace before launching the tests.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\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>Welcome to the October update of Java on Visual Studio Code! This month, we&#8217;re bringing some new features for code navigation, code actions and refactoring, code snippet along with Java 13 support. There&#8217;s also improvements in debugger, maven, checkstyle and Test Runner. <\/p>\n","protected":false},"author":668,"featured_media":226922,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[15],"tags":[25,19,27,28],"class_list":["post-226761","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vscode","tag-debugging","tag-maven","tag-refactoring","tag-testing"],"acf":[],"blog_post_summary":"<p>Welcome to the October update of Java on Visual Studio Code! This month, we&#8217;re bringing some new features for code navigation, code actions and refactoring, code snippet along with Java 13 support. There&#8217;s also improvements in debugger, maven, checkstyle and Test Runner. <\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/226761","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=226761"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/226761\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media\/226922"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media?parent=226761"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/categories?post=226761"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/tags?post=226761"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}