{"id":227249,"date":"2019-11-15T09:00:09","date_gmt":"2019-11-15T17:00:09","guid":{"rendered":"http:\/\/devblogs.microsoft.com\/java\/?p=227249"},"modified":"2019-12-11T18:23:08","modified_gmt":"2019-12-12T02:23:08","slug":"java-on-visual-studio-code-november-update","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/java\/java-on-visual-studio-code-november-update\/","title":{"rendered":"Java on Visual Studio Code November Update"},"content":{"rendered":"<p>Welcome to the November update of Java on Visual Studio Code. Starting this month, we&#8217;re moving to a new home called <a href=\"https:\/\/devblogs.microsoft.com\/java\/\">Java at Microsoft<\/a>, where you can find not only updates about Java on Visual Studio Code, but also other news and insights for Java development with other Microsoft tools, Azure services and OpenJDK. You can subscribe this blog by following @JavaAtMicrosoft.<\/p>\n<p>In this update, we&#8217;d like to share some improvements we&#8217;ve made for code editing experience, more code actions, Java 13 support for Gradle projects and new features in Test Runner and Checkstyle extensions.<\/p>\n<h3>Code Editing<\/h3>\n<h5>Provide better symbol details for the completion proposal<\/h5>\n<p>Originally, we only show javadoc for the auto completion proposal, with a simple header. To provide more detailed information and help you choose the right item, we&#8217;re now adding more detailed symbol info to the header, and hopefully helps you find the right choice faster.<\/p>\n<p>Compare the previous and new information available for field<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-227259\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2019\/11\/field-info.png\" alt=\"\" width=\"708\" height=\"218\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2019\/11\/field-info.png 708w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2019\/11\/field-info-300x92.png 300w\" sizes=\"(max-width: 708px) 100vw, 708px\" \/><\/p>\n<p>Method<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-227260\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2019\/11\/method-info.png\" alt=\"\" width=\"827\" height=\"405\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2019\/11\/method-info.png 827w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2019\/11\/method-info-300x147.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2019\/11\/method-info-768x376.png 768w\" sizes=\"(max-width: 827px) 100vw, 827px\" \/><\/p>\n<p>Type<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-227262\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2019\/11\/type-info.png\" alt=\"\" width=\"797\" height=\"546\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2019\/11\/type-info.png 797w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2019\/11\/type-info-300x206.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2019\/11\/type-info-768x526.png 768w\" sizes=\"(max-width: 797px) 100vw, 797px\" \/><\/p>\n<p>Package<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-227261\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2019\/11\/package-info.png\" alt=\"\" width=\"895\" height=\"357\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2019\/11\/package-info.png 895w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2019\/11\/package-info-300x120.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2019\/11\/package-info-768x306.png 768w\" sizes=\"(max-width: 895px) 100vw, 895px\" \/><\/p>\n<h5>Report unused code as unnecessary<\/h5>\n<p>We&#8217;ve added faded effect to unused code. So now it&#8217;s easier for you to spot them.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-227258\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2019\/11\/unused-code.png\" alt=\"\" width=\"600\" height=\"112\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2019\/11\/unused-code.png 600w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2019\/11\/unused-code-300x56.png 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<h3>Code actions<\/h3>\n<h5>Add &#8216;final&#8217; modifier where possible<\/h5>\n<p>In Java, there is a practice of declaring every variable (local or class), parameter final if they really are. If you like to apply this to you code, you will find this code action useful.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-227267\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2019\/11\/AddFinalModifier.gif\" alt=\"\" width=\"1024\" height=\"768\" \/><\/p>\n<h5>Remove unnecessary cast<\/h5>\n<p>This code action will remove unnecessary cast in your code. (Note: the associated compiler warnings is not enabled by default. To enable this feature, you can manually append the compiler warning <code>org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning<\/code> to the file <code>.settings\/org.eclipse.jdt.core.prefs<\/code>)<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-227268\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2019\/11\/RemoveUncast.gif\" alt=\"\" width=\"763\" height=\"180\" \/><\/p>\n<h3>Other improvements<\/h3>\n<ol>\n<li>Support Java 13 for Gradle project. Gradle 6.x projects with Java 13 are now supported! We&#8217;ve also upgraded embedded maven version to 3.6.2 as well.<\/li>\n<li>Expose <code>Invert Condition<\/code> code action which automatically find the boolean expression around your caret so you don&#8217;t need to select the entire expression to trigger it.<\/li>\n<li>Add text selection support in code snippet so after inserting certain code snippet, VS Code will select\/highlight certain code where you will likely to take action thereafter.<\/li>\n<li><a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=vscjava.vscode-java-test\">Java Test Runner<\/a> now supports module path for your modular Java project. It also added a new &#8216;CollapseAll&#8217; button for you to easily collapse your test cases in test explorer.<\/li>\n<li><a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=shengchen.vscode-checkstyle\">Checkstyle for Java<\/a> added support for custom checkstyle modules. Now you can set any 3rd-party modules for checkstyle using its path. For example, after using the below configuration, you can add\u00a0<code>&lt;module name=\"SingleBreakOrContinueCheck\"\/&gt;<\/code>\u00a0or\u00a0<code>&lt;module name=\"com.github.sevntu.checkstyle.checks.naming.SingleBreakOrContinueCheck\"\/&gt;<\/code>\u00a0to\u00a0<code>checkstyle.xml<\/code> to leverage those checks.<\/li>\n<\/ol>\n<pre class=\"lang:default decode:true\">\"java.checkstyle.modules\": [\r\n    \"${workspaceFolder}\/src\/main\/resources\/sevntu-checks-1.35.0.jar\"\r\n]<\/pre>\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 November update of Java on Visual Studio Code. In this update, we&#8217;d like to share some improvements we&#8217;ve made for code editing experience, more code actions, Java 13 support for Gradle projects and new features in Test Runner and Checkstyle extensions.\u00a0<\/p>\n","protected":false},"author":668,"featured_media":227265,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[474,473,29,248,24,12],"class_list":["post-227249","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","tag-checkstyle","tag-code-action","tag-gradle","tag-java","tag-java-test-runner","tag-visual-studio-code"],"acf":[],"blog_post_summary":"<p>Welcome to the November update of Java on Visual Studio Code. In this update, we&#8217;d like to share some improvements we&#8217;ve made for code editing experience, more code actions, Java 13 support for Gradle projects and new features in Test Runner and Checkstyle extensions.\u00a0<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/227249","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=227249"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/227249\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media\/227265"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media?parent=227249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/categories?post=227249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/tags?post=227249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}