{"id":228155,"date":"2021-05-13T17:56:32","date_gmt":"2021-05-14T00:56:32","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/java\/?p=228155"},"modified":"2021-05-13T17:56:32","modified_gmt":"2021-05-14T00:56:32","slug":"java-on-visual-studio-code-update-april-2021","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/java\/java-on-visual-studio-code-update-april-2021\/","title":{"rendered":"Java on Visual Studio Code Update \u2013 April 2021"},"content":{"rendered":"<p>Welcome to VS Code update for Java. Another busy and productive month. <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=vscjava.vscode-java-debug\">Debugger for Java<\/a> and <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=vscjava.vscode-java-test\">Java Test Runner<\/a> extensions got new features. Before jump into details, we would like to remind Microsoft Build 2021 is coming. You will hear more about Java and VS Code this time, so please <a href=\"https:\/\/mybuild.microsoft.com\/?wt.mc_ID=Build2021_corp_bl_oo_bl_CO_Dev\">join<\/a> us.<\/p>\n<h3><strong>Inline Values and Customized Variables View for Debugging<\/strong><\/h3>\n<p>By adopting a new debugger extension API, <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=vscjava.vscode-java-debug\">Debugger for Java<\/a> extension is now able to show variable values inline in editor when stepping through source code.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2021\/05\/inlineValues.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-228157\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2021\/05\/inlineValues.png\" alt=\"Image inlineValues\" width=\"1794\" height=\"940\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2021\/05\/inlineValues.png 1794w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2021\/05\/inlineValues-300x157.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2021\/05\/inlineValues-1024x537.png 1024w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2021\/05\/inlineValues-768x402.png 768w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2021\/05\/inlineValues-1536x805.png 1536w\" sizes=\"(max-width: 1794px) 100vw, 1794px\" \/><\/a><\/p>\n<p>You can enable this feature by selecting <strong>Files<\/strong>-&gt;<strong>Preferences<\/strong>-&gt;<strong>Settings<\/strong> menu, searching for \u201c<strong>debug.inlineValues<\/strong>\u201d on settings view, and selecting the option.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2021\/05\/inlineValuesSetting.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-228158\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2021\/05\/inlineValuesSetting.png\" alt=\"Image inlineValuesSetting\" width=\"2191\" height=\"408\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2021\/05\/inlineValuesSetting.png 2191w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2021\/05\/inlineValuesSetting-300x56.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2021\/05\/inlineValuesSetting-1024x191.png 1024w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2021\/05\/inlineValuesSetting-768x143.png 768w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2021\/05\/inlineValuesSetting-1536x286.png 1536w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2021\/05\/inlineValuesSetting-2048x381.png 2048w\" sizes=\"(max-width: 2191px) 100vw, 2191px\" \/><\/a><\/p>\n<p>Customized variables view is also supported now. You can right-clicking the view to bring up customization menu.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2021\/05\/variablesViewCustomization.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-228159\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2021\/05\/variablesViewCustomization.png\" alt=\"Image variablesViewCustomization\" width=\"790\" height=\"708\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2021\/05\/variablesViewCustomization.png 790w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2021\/05\/variablesViewCustomization-300x269.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2021\/05\/variablesViewCustomization-768x688.png 768w\" sizes=\"(max-width: 790px) 100vw, 790px\" \/><\/a><\/p>\n<p>Both features were demonstrated at VS Code 1.56 Release Party. Check out <a href=\"https:\/\/channel9.msdn.com\/Shows\/VS-Code-Livestreams\/1-56-Release-Party#time=20m55s\">here<\/a> for more details.<\/p>\n<h3><strong>Generating Tests<\/strong><\/h3>\n<p>Automatically generating testing method templates and importing testing packages is a handy feature to improve coding efficiency. Starting from April, you can generate the method templates directly from a test file. In May, we will also add support for generating from a source file.<\/p>\n<p>To generate testing method templates, open or create a test file under project\u2019s test folder, right-click on file editor to invoke context menu, select \u201c<strong>Source Action\u2026<\/strong>\u201d and then \u201c<strong>Generate Test\u2026<\/strong>\u201d, and finally select methods to generate.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2021\/05\/generate-test.gif\"><img decoding=\"async\" class=\"alignnone size-full wp-image-228160\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2021\/05\/generate-test.gif\" alt=\"Image generate test\" width=\"2031\" height=\"1528\" \/><\/a><\/p>\n<p><strong>Note<\/strong>: for generating from a test file, testing dependency need be added into your project.<\/p>\n<h3><strong>Enhancements<\/strong><\/h3>\n<ul>\n<li>Java 16 is supported.<\/li>\n<li>Refined creating Maven project experience. Now, you will be promoted to open project right after the completion of creation.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2021\/05\/createMavenProject.gif\"><img decoding=\"async\" class=\"alignnone size-full wp-image-228161\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2021\/05\/createMavenProject.gif\" alt=\"Image createMavenProject\" width=\"2030\" height=\"1528\" \/><\/a><\/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 VS Code update for Java. Another busy and productive month. Debugger for Java and Java Test Runner extensions got new features. <\/p>\n","protected":false},"author":26010,"featured_media":228172,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,8,15],"tags":[25,248,782,19,28,12],"class_list":["post-228155","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","category-open-source","category-vscode","tag-debugging","tag-java","tag-java-16","tag-maven","tag-testing","tag-visual-studio-code"],"acf":[],"blog_post_summary":"<p>Welcome to VS Code update for Java. Another busy and productive month. Debugger for Java and Java Test Runner extensions got new features. <\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/228155","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\/26010"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/comments?post=228155"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/228155\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media\/228172"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media?parent=228155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/categories?post=228155"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/tags?post=228155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}