{"id":225753,"date":"2019-06-24T10:00:17","date_gmt":"2019-06-24T17:00:17","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/visualstudio\/?p=225753"},"modified":"2019-11-14T15:05:53","modified_gmt":"2019-11-14T23:05:53","slug":"java-on-visual-studio-code-june-update","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/java\/java-on-visual-studio-code-june-update\/","title":{"rendered":"Java on Visual Studio Code June Update"},"content":{"rendered":"<p>Welcome to the June update of Java on Visual Studio Code!<\/p>\n<p>Earlier this month, we shared our new <a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/announcing-visual-studio-code-java-installer\/\">Java Installer for Visual Studio Code<\/a>, which aims to help new Java developers to get their environment ready and start coding in just a few clicks. In this update, we\u2019d like to share a couple new features and enhancements delivered during last few weeks.<\/p>\n<h3>More code actions<\/h3>\n<p>Developers need refactoring and code actions to achieve high productivity, so we&#8217;re bringing more of those features to you.<\/p>\n<h5>Enhanced \u201cGenerate getters and setters\u201d<\/h5>\n<p>In addition to bulk generate getters and setters for all member variables, if the class has more than one field, the source action will also prompt a quick pick box which allows you to select the target fields to generate the accessor methods.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-225773\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/advancedGetterSetter.gif\" alt=\"\" width=\"1024\" height=\"768\" \/><\/p>\n<p>The source action is also aware of the <em>java.codeGeneration.generateComments<\/em> preference and will use it to decide whether to generate comments for getter and setter methods.<\/p>\n<h5>Generate Delegate Methods<\/h5>\n<p>This new code action enables generating delegate methods.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-225774\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/generateDelegateMethods.gif\" alt=\"\" width=\"1024\" height=\"768\" \/><\/p>\n<h5>Generate Constructor<\/h5>\n<p>This source action helps adding constructor from super class.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-225756\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/generate-constructor.gif\" alt=\"\" width=\"1024\" height=\"768\" \/><\/p>\n<h5>Assign parameter to new field<\/h5>\n<p>This source action assigns parameter to new field for unused constructor parameter(s).<\/p>\n<h4><img decoding=\"async\" class=\"alignnone size-full wp-image-225757\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/assign-to-field.gif\" alt=\"\" width=\"638\" height=\"280\" \/><\/h4>\n<h3>Performance improvements<\/h3>\n<p>A set of changes have been made to further improve performance of Java in Visual Studio Code, including a fix for I\/O issue on Windows platform, reducing memory footprint for large projects with deep modules and batch project imports. VS Code is a lightweight editor and we&#8217;d like to make sure it still feels just like an editor when despite more and more features being added to it.<\/p>\n<h3>Debugger updates<\/h3>\n<p>Debugging is the most frequent used feature second only to code editing. We&#8217;d like you to enjoy debugging Java in Visual Studio Code.<\/p>\n<h5>Show more meaningful value in variable window and hover tool-tip<\/h5>\n<p>We&#8217;re now providing additional detailed information for variables during debug<\/p>\n<ul>\n<li>For the classes that override &#8216;<em>toString<\/em>&#8216; method, show <em>toString()<\/em> details.<\/li>\n<li>For Collection and Map classes, show an additional size=x details.<\/li>\n<li>For Entry, show key:value details<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-225775\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/tostring-view-for-object-variable.png\" alt=\"\" width=\"1146\" height=\"390\" \/><\/p>\n<h5>New HCR button<\/h5>\n<p>To better expose the hot code replace feature and let you control it more explicitly, we&#8217;ve added a new button to the toolbar and provided a new debug setting `java.debug.settings.hotCodeReplace` to allow you control how to trigger HCR. Default to `manual`.<\/p>\n<ul>\n<li>manual &#8211; Click the toolbar to apply the change to running app<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-225778\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/hcr-button.png\" alt=\"\" width=\"301\" height=\"40\" \/><\/p>\n<ul>\n<li>auto &#8211; Automatically apply the changes after compilation. This is the old behavior.<\/li>\n<li>never &#8211; Never apply the changes<\/li>\n<\/ul>\n<p>See HCR in action<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-225781\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/hcr.gif\" alt=\"\" width=\"1024\" height=\"768\" \/><\/p>\n<h5>Global setting for selecting debug console<\/h5>\n<p>While VS Code offers a powerful Debug Console\u00a0with REPL (Read-Eval-Print Loop)\u00a0functionality, one major restriction of it is it doesn\u2019t accept input. For those programs which need to take console input, developers need to specify to use integratedTerminal instead of internalConsole in launch.json.<\/p>\n<pre class=\"lang:default decode:true\">\"console\": \"integratedTerminal\"<\/pre>\n<p>However, this is not convenient if you need to do it repeatedly. Now we\u2019re introducing a global setting, <em>java.debug.settings.console<\/em>. you can use this setting to configure the default debug console so you don\u2019t need to change the launch.json every time.<\/p>\n<pre class=\"lang:default decode:true \">\"java.debug.settings.console\": \"integratedTerminal\"<\/pre>\n<h3>Other updates<\/h3>\n<h5>Maven<\/h5>\n<p>2 new configs are now available for Maven extension<\/p>\n<ol>\n<li><em>pomfile.globPattern<\/em> \u2013 specified how the extension search for POM file.<\/li>\n<li><em>pomfile.autoUpdateEffectivePOM<\/em> \u2013 specifies whether to update Effective-POM automatically.<\/li>\n<\/ol>\n<h5>Test Runner<\/h5>\n<p>In recent releases, we\u2019ve added support for a couple additional JUnit5 annotations, such as <em>@Nested<\/em> and <em>@TestFactory<\/em>. Test runner will also automatically show the test report after execution now.<\/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>Welcome to the June update of Java on Visual Studio Code! Earlier this month, we shared our new Java Installer for Visual Studio Code, which aims to help new Java developers to get their environment ready and start coding in just a few clicks. In this update, we\u2019d like to share a couple new features [&hellip;]<\/p>\n","protected":false},"author":668,"featured_media":226928,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[15],"tags":[25,24,19,26,27,12],"class_list":["post-225753","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vscode","tag-debugging","tag-java-test-runner","tag-maven","tag-performance","tag-refactoring","tag-visual-studio-code"],"acf":[],"blog_post_summary":"<p>Welcome to the June update of Java on Visual Studio Code! Earlier this month, we shared our new Java Installer for Visual Studio Code, which aims to help new Java developers to get their environment ready and start coding in just a few clicks. In this update, we\u2019d like to share a couple new features [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/225753","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=225753"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/225753\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media\/226928"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media?parent=225753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/categories?post=225753"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/tags?post=225753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}