{"id":230384,"date":"2024-01-30T23:40:42","date_gmt":"2024-01-31T07:40:42","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/java\/?p=230384"},"modified":"2024-01-30T23:40:42","modified_gmt":"2024-01-31T07:40:42","slug":"java-on-visual-studio-code-update-january-2024","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/java\/java-on-visual-studio-code-update-january-2024\/","title":{"rendered":"Java on Visual Studio Code Update &#8211; January 2024"},"content":{"rendered":"<p>Hi everyone, welcome to the first update for Visual Studio Code for Java of 2024! We hope everyone had a refreshing break. In this blog we have some exciting updates for the new Test Coverage UX as well as reliability and general user experience updates, so let&#8217;s get started!<\/p>\n<h3><strong>Update of Java 21 Feature Support<\/strong><\/h3>\n<p>As shared in <a href=\"https:\/\/devblogs.microsoft.com\/java\/2-5-million-java-developers-on-visual-studio-code\/\">our roadmap blog post<\/a> last December, integrating JDK 21 support is a key focus in enhancing fundamental experience. Following its release, many efforts have been done to supports its features. We&#8217;re pleased to share our progress. Here&#8217;s a summary of the features we currently support and those still in progress.<\/p>\n<p><strong>Current Status<\/strong> (List referenced from <a href=\"https:\/\/openjdk.org\/projects\/jdk\/21\/\">here<\/a>)<\/p>\n<blockquote>\n<table class=\"jeps\" style=\"width: 64.9963%; height: 446px;\" summary=\"jeps\">\n<tbody>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 7.74487%;\">430:<\/td>\n<td style=\"height: 28px; width: 71.2115%;\"><a href=\"https:\/\/openjdk.org\/jeps\/430\">String Templates (Preview)<\/a><\/td>\n<td style=\"width: 77.3931%;\"><span style=\"color: #339966;\"><strong>Supported<\/strong><\/span><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 7.74487%;\">431:<\/td>\n<td style=\"height: 28px; width: 71.2115%;\"><a href=\"https:\/\/openjdk.org\/jeps\/431\">Sequenced Collections<\/a><\/td>\n<td style=\"width: 77.3931%;\"><strong><span style=\"color: #339966;\">Supported<\/span><\/strong><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 7.74487%;\">439:<\/td>\n<td style=\"height: 28px; width: 71.2115%;\"><a href=\"https:\/\/openjdk.org\/jeps\/439\">Generational ZGC<\/a><\/td>\n<td style=\"width: 77.3931%;\"><strong><span style=\"color: #339966;\">Supported<\/span><\/strong><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 7.74487%;\">440:<\/td>\n<td style=\"height: 28px; width: 71.2115%;\"><a href=\"https:\/\/openjdk.org\/jeps\/440\">Record Patterns<\/a><\/td>\n<td style=\"width: 77.3931%;\"><span style=\"color: #339966;\"><strong>Supported<\/strong><\/span><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 7.74487%;\">441:<\/td>\n<td style=\"height: 28px; width: 71.2115%;\"><a href=\"https:\/\/openjdk.org\/jeps\/441\">Pattern Matching for switch<\/a><\/td>\n<td style=\"width: 77.3931%;\"><strong><span style=\"color: #339966;\">Supported<\/span><\/strong><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 7.74487%;\">442:<\/td>\n<td style=\"height: 28px; width: 71.2115%;\"><a href=\"https:\/\/openjdk.org\/jeps\/442\">Foreign Function &amp; Memory API (Third Preview)<\/a><\/td>\n<td style=\"width: 77.3931%;\"><span style=\"color: #339966;\"><strong>Supported<\/strong><\/span><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 7.74487%;\">443:<\/td>\n<td style=\"height: 28px; width: 71.2115%;\"><a href=\"https:\/\/openjdk.org\/jeps\/443\">Unnamed Patterns and Variables (Preview)<\/a><\/td>\n<td style=\"width: 77.3931%;\"><span style=\"color: #ffcc00;\"><strong>Work In Progress<\/strong><\/span><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 7.74487%;\">444:<\/td>\n<td style=\"height: 28px; width: 71.2115%;\"><a href=\"https:\/\/openjdk.org\/jeps\/444\">Virtual Threads<\/a><\/td>\n<td style=\"width: 77.3931%;\"><strong><span style=\"color: #339966;\">Supported<\/span><\/strong><\/td>\n<\/tr>\n<tr style=\"height: 54px;\">\n<td style=\"height: 54px; width: 7.74487%;\">445:<\/td>\n<td style=\"height: 54px; width: 71.2115%;\"><a href=\"https:\/\/openjdk.org\/jeps\/445\">Unnamed Classes and Instance Main Methods (Preview)<\/a><\/td>\n<td style=\"width: 77.3931%;\"><span style=\"color: #ffcc00;\"><strong>Work In Progress<\/strong><\/span><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 7.74487%;\">446:<\/td>\n<td style=\"height: 28px; width: 71.2115%;\"><a href=\"https:\/\/openjdk.org\/jeps\/446\">Scoped Values (Preview)<\/a><\/td>\n<td style=\"width: 77.3931%;\"><strong><span style=\"color: #339966;\">Supported<\/span><\/strong><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 7.74487%;\">448:<\/td>\n<td style=\"height: 28px; width: 71.2115%;\"><a href=\"https:\/\/openjdk.org\/jeps\/448\">Vector API (Sixth Incubator)<\/a><\/td>\n<td style=\"width: 77.3931%;\"><strong><span style=\"color: #339966;\">Supported<\/span><\/strong><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 7.74487%;\">449:<\/td>\n<td style=\"height: 28px; width: 71.2115%;\"><a href=\"https:\/\/openjdk.org\/jeps\/449\">Deprecate the Windows 32-bit x86 Port for Removal<\/a><\/td>\n<td style=\"width: 77.3931%;\"><strong><span style=\"color: #339966;\">Supported<\/span><\/strong><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 7.74487%;\">451:<\/td>\n<td style=\"height: 28px; width: 71.2115%;\"><a href=\"https:\/\/openjdk.org\/jeps\/451\">Prepare to Disallow the Dynamic Loading of Agents<\/a><\/td>\n<td style=\"width: 77.3931%;\"><strong><span style=\"color: #339966;\">Supported<\/span><\/strong><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 7.74487%;\">452:<\/td>\n<td style=\"height: 28px; width: 71.2115%;\"><a href=\"https:\/\/openjdk.org\/jeps\/452\">Key Encapsulation Mechanism API<\/a><\/td>\n<td style=\"width: 77.3931%;\"><strong><span style=\"color: #339966;\">Supported<\/span><\/strong><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 7.74487%;\">453:<\/td>\n<td style=\"height: 28px; width: 71.2115%;\"><a href=\"https:\/\/openjdk.org\/jeps\/453\">Structured Concurrency (Preview)<\/a><\/td>\n<td style=\"width: 77.3931%;\"><strong><span style=\"color: #339966;\">Supported<\/span><\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/blockquote>\n<p>We will continue to work on the remaining features and share an update again soon. For users who currently do not need features that are work in progress, you can already use JDK 21 in Visual Studio Code Java.<\/p>\n<h3><strong>Test Coverage UX Updates<\/strong><\/h3>\n<p>In our previous blog, we shared the <a href=\"https:\/\/devblogs.microsoft.com\/java\/java-on-visual-studio-code-update-december-2023\/\">new Test Coverage feature<\/a> that can already be used in Visual Studio Code Insider version. However, the previous feature requires the users to select &#8220;<strong>Execute Using Profile<\/strong>&#8221; in order to see the coverage results, which is not intuitive. In addition, there is no coverage visualization in the editor area about your code on which is covered or not. In our latest pre-release version, we have made improvements for both of these issues. Now you can get to test coverage by just clicking the &#8220;<strong>Run Test With Coverage<\/strong>&#8221; button right next to &#8220;Debug Test&#8221; (Please note the icon is still a placeholder and will be changed). Here&#8217;s a demo.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/01\/coverage.gif\"><img decoding=\"async\" class=\"alignnone size-full wp-image-230395\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/01\/coverage.gif\" alt=\"Image coverage\" width=\"1700\" height=\"1080\" \/><\/a><\/p>\n<p>In addition, you can see if the code is already covered by the test in the editor area.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/01\/coveragevisualization.gif\"><img decoding=\"async\" class=\"alignnone size-full wp-image-230394\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/01\/coveragevisualization.gif\" alt=\"Test Coverage Visualization\" width=\"1700\" height=\"1080\" \/><\/a><\/p>\n<p>To use the new Test Coverage feature, please make sure you have both <a href=\"https:\/\/code.visualstudio.com\/insiders\/\">Visual Studio Code Insiders<\/a> and <strong>Pre-release version<\/strong> of <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=vscjava.vscode-java-pack\">Extension Pack for Java<\/a> installed.<\/p>\n<h3><strong>Java Language Server Status UX Improvement<\/strong><\/h3>\n<p>Another UX improvement is about the Java Language Server status. Previously, users see the <strong>{} status icon<\/strong> only if current opened file is Java file. This is inconvenient for many users as Java projects might contain other types of files, especially for users who work on polyglot projects. In our latest version, we have made an improvement for the status icon. The icon is now parallel to <strong>{}<\/strong> for an easier access. In addition, now as long as Java extension is activated, the icon will display the status of the Java Language Server, regardless of the current opened file. The pictures below demonstrate the difference.<\/p>\n<p><strong>Before\u00a0<\/strong><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/01\/before.png\"><img decoding=\"async\" class=\"alignnone wp-image-230398\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/01\/before.png\" alt=\"Java Language Server Icon Before\" width=\"336\" height=\"154\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/01\/before.png 607w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/01\/before-300x137.png 300w\" sizes=\"(max-width: 336px) 100vw, 336px\" \/><\/a><\/p>\n<p><strong>After<\/strong><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/01\/after.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-230399\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/01\/after.png\" alt=\"Java Language Server After\" width=\"332\" height=\"169\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/01\/after.png 332w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2024\/01\/after-300x153.png 300w\" sizes=\"(max-width: 332px) 100vw, 332px\" \/><\/a><\/p>\n<h3><strong>Fix for &#8220;Editor Content Out of Sync&#8221; Issue<\/strong><\/h3>\n<p>Reliability has always been our top priority, and recently we discovered an <a href=\"https:\/\/github.com\/eclipse-jdtls\/eclipse.jdt.ls\/issues\/2955\">issue<\/a> that causes editor content to be out of sync with the Java Language Server, which will in turn report false errors. This has been reported by users in our survey as well as on GitHub.<\/p>\n<p>We have already released a fix for this issue. After the release, we have observed in a notable reduction of occurrences. If you encounter any further problems, please do not hesitate to <a href=\"https:\/\/github.com\/microsoft\/vscode-java-pack\/issues\">create an issue<\/a> here.<\/p>\n<h3><strong>Install Extension Pack for Java<\/strong><\/h3>\n<p>To use all features mentioned above, please download and install <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=vscjava.vscode-java-pack\">Extension Pack for Java<\/a> on Visual Studio Code.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/09\/javapack.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-229421\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/09\/javapack.png\" alt=\"Extension pack for Java\" width=\"1215\" height=\"238\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/09\/javapack.png 1215w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/09\/javapack-300x59.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/09\/javapack-1024x201.png 1024w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/09\/javapack-768x150.png 768w\" sizes=\"(max-width: 1215px) 100vw, 1215px\" \/><\/a><\/p>\n<p>If you are a Spring developer working on a Spring Boot application, you can also download the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=Pivotal.vscode-boot-dev-pack\">Spring Boot Extension Pack<\/a> for specialized Spring experience.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/10\/spring.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-229533\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/10\/spring.png\" alt=\"Spring boot extension pack\" width=\"1221\" height=\"224\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/10\/spring.png 1221w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/10\/spring-300x55.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/10\/spring-1024x188.png 1024w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/10\/spring-768x141.png 768w\" sizes=\"(max-width: 1221px) 100vw, 1221px\" \/><\/a><\/p>\n<h3><span style=\"font-size: 18pt;\"><strong><span class=\"x-hidden-focus\">Feedback and suggestions<\/span><\/strong><\/span><\/h3>\n<p>As always, your feedback and suggestions are very important to us and will help shape our product in future. There are several ways to give us feedback<\/p>\n<ul>\n<li>Leave your comment on this blog post<\/li>\n<li><a href=\"https:\/\/github.com\/microsoft\/vscode-java-pack\/issues\/new\/choose\" target=\"_blank\" rel=\"noopener\">Open an issue<\/a>\u00a0on our GitHub Issues page<\/li>\n<li>Send an email to: vscjfeedback@microsoft.com<\/li>\n<\/ul>\n<h3 id=\"try-it-out\" class=\"x-hidden-focus\"><span style=\"font-size: 18pt;\"><strong><span class=\"x-hidden-focus\">Resources<\/span><\/strong><\/span><\/h3>\n<p>Here is a list of links that are helpful to learn Java on Visual Studio Code.<\/p>\n<ul>\n<li class=\"x-hidden-focus\">Learn more about\u00a0<a class=\"x-hidden-focus\" href=\"https:\/\/code.visualstudio.com\/docs\/languages\/java\" target=\"_blank\" rel=\"noopener noreferrer\">Java on Visual Studio Code<\/a>.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Hi everyone, welcome to the first update for Visual Studio Code for Java of 2024! We hope everyone had a refreshing break. In this blog we have some exciting updates for the new Test Coverage UX as well as reliability and general user experience updates, so let&#8217;s get started! Update of Java 21 Feature Support [&hellip;]<\/p>\n","protected":false},"author":31999,"featured_media":230422,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[14,22,1,8,15],"tags":[],"class_list":["post-230384","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud","category-desktop","category-java","category-open-source","category-vscode"],"acf":[],"blog_post_summary":"<p>Hi everyone, welcome to the first update for Visual Studio Code for Java of 2024! We hope everyone had a refreshing break. In this blog we have some exciting updates for the new Test Coverage UX as well as reliability and general user experience updates, so let&#8217;s get started! Update of Java 21 Feature Support [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/230384","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\/31999"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/comments?post=230384"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/230384\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media\/230422"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media?parent=230384"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/categories?post=230384"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/tags?post=230384"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}