{"id":230000,"date":"2023-07-26T02:47:43","date_gmt":"2023-07-26T09:47:43","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/java\/?p=230000"},"modified":"2023-07-26T07:20:09","modified_gmt":"2023-07-26T14:20:09","slug":"java-on-visual-studio-code-july-2023","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/java\/java-on-visual-studio-code-july-2023\/","title":{"rendered":"Java on Visual Studio Code &#8211; July 2023"},"content":{"rendered":"<p>Hi everyone, welcome to our July update for Visual Studio Code for Java! In this blog we are going to provide you an exciting update about our improved decompiler functionality. Additionally, we are going to do a deep-dive into our code completion. Let&#8217;s get started!<\/p>\n<h3><span style=\"font-size: 18pt;\"><strong>Decompiler Experience Upgrade<\/strong><\/span><\/h3>\n<p>Java decompiler is essential for understanding third-party libraries, debugging, and learning from well-written code. It helps the developer to reverse engineer compiled Java bytecode back into human-readable Java source code, enhancing the productivity and code comprehension.<\/p>\n<p>Previously, users have reported that our extensions did not have good support of proper decompiling and debugging code. In our latest release, we have embedded a powerful Java decompiler called Fernflower (Currently an open-source project and used in IntelliJ IDEA) in <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=vscjava.vscode-java-pack\">our extension pack<\/a>. With this decompiler, our extension allows you to directly click into libraries and it will automatically decompile the bytecode into readable source code. Inside the decompiled code, you can debug like what you do normally. We hope this feature will greatly boost your productivity during development. Here&#8217;s a simple demo.<\/p>\n<p><figure id=\"attachment_230009\" aria-labelledby=\"figcaption_attachment_230009\" class=\"wp-caption alignnone\" ><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2023\/07\/decompile_debugging.gif\"><img decoding=\"async\" class=\"size-full wp-image-230009\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2023\/07\/decompile_debugging.gif\" alt=\"Decompiler experience upgrade\" width=\"2380\" height=\"1506\" \/><\/a><figcaption id=\"figcaption_attachment_230009\" class=\"wp-caption-text\">Decompiler experience upgrade<\/figcaption><\/figure><\/p>\n<h2><span style=\"font-size: 18pt;\"><strong>Toggling Inlay Hint on the Fly<\/strong><\/span><\/h2>\n<p>Inlay Hint is a popular feature in Visual Studio Code and many other developer tools. It adds inline information to the source code to help you understand what the code does, such as parameter names, parameter types, variable types and so on. However, we have heard from Java developers that sometimes these inline markers have obscured the original code and the editor becomes too crowded. Actually, Visual Studio Code has a setting that allows you to toggle inlay hints on the fly so you can turn it on\/off as you are typing the code, easily tuning your experience. The setting can be found by searching for &#8220;inlay hints&#8221; and selecting the options from the image below.<\/p>\n<p><figure id=\"attachment_230020\" aria-labelledby=\"figcaption_attachment_230020\" class=\"wp-caption alignnone\" ><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2023\/07\/inlayhints.png\"><img decoding=\"async\" class=\"size-full wp-image-230020\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2023\/07\/inlayhints.png\" alt=\"Toggling Inlay Hints on the fly\" width=\"2285\" height=\"1197\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2023\/07\/inlayhints.png 2285w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2023\/07\/inlayhints-300x157.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2023\/07\/inlayhints-1024x536.png 1024w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2023\/07\/inlayhints-768x402.png 768w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2023\/07\/inlayhints-1536x805.png 1536w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2023\/07\/inlayhints-2048x1073.png 2048w\" sizes=\"(max-width: 2285px) 100vw, 2285px\" \/><\/a><figcaption id=\"figcaption_attachment_230020\" class=\"wp-caption-text\">Toggling Inlay Hints on the fly<\/figcaption><\/figure><\/p>\n<p>Here&#8217;s a simple demo.<\/p>\n<p><figure id=\"attachment_230023\" aria-labelledby=\"figcaption_attachment_230023\" class=\"wp-caption alignnone\" ><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2023\/07\/inlayhints.gif\"><img decoding=\"async\" class=\"size-full wp-image-230023\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2023\/07\/inlayhints.gif\" alt=\"Toggle inlay hints on the fly demo\" width=\"1556\" height=\"1080\" \/><\/a><figcaption id=\"figcaption_attachment_230023\" class=\"wp-caption-text\">Toggle inlay hints on the fly demo<\/figcaption><\/figure><\/p>\n<h2><span style=\"font-size: 18pt;\"><strong>Code Completion Performance Improvement Deep-Dive<\/strong><\/span><\/h2>\n<p>We have consistently stressed the importance of code completion performance and its critical role of boosting the developer&#8217;s productivity. In <a href=\"https:\/\/devblogs.microsoft.com\/java\/java-on-visual-studio-code-june-2023\/\">our previous blog post<\/a>, we have shown the latency improvement of our recent code performance. In this month, we are pleased to share even more progress and technical details of how we have managed to make this improvement.<\/p>\n<h4><strong><span style=\"font-size: 14pt;\">Reduction in code completion time (compared to previous version)<\/span><\/strong><\/h4>\n<table style=\"border-collapse: collapse; width: 100%;\">\n<tbody>\n<tr>\n<td style=\"width: 14.2857%;\">Extension Version<\/td>\n<td style=\"width: 14.2857%;\">Average<\/td>\n<td style=\"width: 14.2857%;\">P99<\/td>\n<td style=\"width: 14.2857%;\">P95<\/td>\n<td style=\"width: 14.2857%;\">P90<\/td>\n<td style=\"width: 14.2857%;\">P75<\/td>\n<td style=\"width: 14.2857%;\">P50<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 14.2857%;\">1.18 (compared to 1.17)<\/td>\n<td style=\"width: 14.2857%;\">13.85%<\/td>\n<td style=\"width: 14.2857%;\">56.15%<\/td>\n<td style=\"width: 14.2857%;\">49.36%<\/td>\n<td style=\"width: 14.2857%;\">50.22%<\/td>\n<td style=\"width: 14.2857%;\">13.69%<\/td>\n<td style=\"width: 14.2857%;\">34.38%<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 14.2857%;\">1.19 (compared to 1.18)<\/td>\n<td style=\"width: 14.2857%;\">55.65%<\/td>\n<td style=\"width: 14.2857%;\">17.19%<\/td>\n<td style=\"width: 14.2857%;\">17.01%<\/td>\n<td style=\"width: 14.2857%;\">15.18%<\/td>\n<td style=\"width: 14.2857%;\">14.14%<\/td>\n<td style=\"width: 14.2857%;\">9.52%<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>As the table shows, after 1.19 release, the code completion latency has been reduced significantly in average time and in all percentile ranks.<\/p>\n<p>The code completion optimization efforts are tightly linked to the Eclipse Java Development (JDT) Language Server and our work is focused on three main areas.<\/p>\n<h4><strong><span style=\"font-size: 14pt;\" data-contrast=\"none\">Optimize Diagnostic Jobs<\/span><\/strong><\/h4>\n<p><span data-contrast=\"none\">Related Pull Requests: <\/span><a href=\"https:\/\/github.com\/eclipse\/eclipse.jdt.ls\/pull\/2587\"><span data-contrast=\"none\">PR #2587<\/span><\/a><span data-contrast=\"none\">, <a href=\"https:\/\/github.com\/eclipse\/eclipse.jdt.ls\/pull\/2574\">PR #2574<\/a>,\u00a0 <\/span><a href=\"https:\/\/github.com\/eclipse\/eclipse.jdt.ls\/pull\/2664\"><span data-contrast=\"none\">PR #2664<\/span><\/a><\/p>\n<p><span data-contrast=\"none\">The diagnostic jobs in the Eclipse JDT Language Server are responsible for analyzing Java source code and providing feedback on potential issues such as compiler errors and warnings. These PRs introduce optimizations to the diagnostic job processing, resulting in improved performance and reduced latency in providing code diagnostics. By fine-tuning the diagnostic analysis, developers can receive faster feedback and gain insights into their codebase more promptly.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559738&quot;:300,&quot;335559739&quot;:300,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h4><strong><span style=\"font-size: 14pt;\" data-contrast=\"none\">Optimize Request Handler Scheduling Rules<\/span><\/strong><\/h4>\n<p><span data-contrast=\"none\">Related Pull Requests: <\/span><a href=\"https:\/\/github.com\/eclipse\/eclipse.jdt.ls\/pull\/2637\"><span data-contrast=\"none\">PR #2637<\/span><\/a><span data-contrast=\"none\">, <\/span><a href=\"https:\/\/github.com\/eclipse\/eclipse.jdt.ls\/pull\/2641\"><span data-contrast=\"none\">PR #2641<\/span><\/a><span data-contrast=\"none\">, <\/span><a href=\"https:\/\/github.com\/eclipse\/eclipse.jdt.ls\/pull\/2643\"><span data-contrast=\"none\">PR #2643<\/span><\/a><span data-contrast=\"none\">, <\/span><a href=\"https:\/\/github.com\/eclipse\/eclipse.jdt.ls\/pull\/2659\"><span data-contrast=\"none\">PR #2659<\/span><\/a><span data-contrast=\"none\">, <\/span><a href=\"https:\/\/github.com\/eclipse\/eclipse.jdt.ls\/pull\/2660\"><span data-contrast=\"none\">PR #2660<\/span><\/a><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"none\">Effective scheduling of request handlers is vital in handling incoming code completion requests from the IDE. The mentioned PRs focus on optimizing the scheduling rules used by the Eclipse JDT Language Server to prioritize and process code completion requests efficiently. These improvements enable the server to allocate resources more effectively, resulting in reduced contention and faster response times. By streamlining request handler scheduling, developers can experience a more responsive code completion workflow.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559738&quot;:300,&quot;335559739&quot;:300,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h4><strong><span style=\"font-size: 14pt;\" data-contrast=\"none\">Optimize Completion Request Handler<\/span><\/strong><\/h4>\n<p><span data-contrast=\"none\">Related Pull Requests: <\/span><a href=\"https:\/\/github.com\/eclipse\/eclipse.jdt.ls\/pull\/2642\"><span data-contrast=\"none\">PR #2642<\/span><\/a><span data-contrast=\"none\">, <\/span><a href=\"https:\/\/github.com\/eclipse\/eclipse.jdt.ls\/pull\/2639\"><span data-contrast=\"none\">PR #2639<\/span><\/a><span data-contrast=\"none\">, <\/span><a href=\"https:\/\/github.com\/eclipse\/eclipse.jdt.ls\/pull\/2621\"><span data-contrast=\"none\">PR #2621<\/span><\/a><span data-contrast=\"none\">, <a href=\"https:\/\/github.com\/eclipse\/eclipse.jdt.ls\/pull\/2614\">PR #2614<\/a>, <\/span><a href=\"https:\/\/github.com\/eclipse\/eclipse.jdt.ls\/pull\/2638\"><span data-contrast=\"none\">PR #2638<\/span><\/a><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"none\">The completion request handler is responsible for generating code completion suggestions based on the context within the IDE. These PRs introduce optimizations to the completion request handling process, resulting in faster and more accurate suggestion generation. <\/span><span data-contrast=\"auto\">The work was mainly focused in two areas<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240,&quot;335559740&quot;:279}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559683&quot;:0,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Return suggestion list first and lazily calculate the inserted text<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240,&quot;335559740&quot;:279}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559683&quot;:0,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Reduce the payload size for completion response and reduce the serialization\/deserialization and cost<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:240,&quot;335559740&quot;:279}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-contrast=\"none\">By enhancing the completion request handler, developers can experience a significant improvement in the speed and relevance of code completion suggestions, enabling them to write code more efficiently.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559738&quot;:300,&quot;335559739&quot;:300,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p>We want to thank everyone in the open-source community who is involved in these PRs. The progress we have achieved in enhancing code completion serves as a promising milestone of our ongoing commitment to improving Visual Studio Code Java&#8217;s performance. In addition to code completion, we will continue to refine and optimize the reliability and compatibility of our Java language server (such as less crash in our extension and errors when building the projects). Please stay tuned with our upcoming blog posts.<\/p>\n<h4><strong>Install Extension Pack for Java<\/strong><\/h4>\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<h2><span style=\"font-size: 18pt;\"><strong><span class=\"x-hidden-focus\">Feedback and suggestions<\/span><\/strong><\/span><\/h2>\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<h2 id=\"try-it-out\" class=\"x-hidden-focus\"><span style=\"font-size: 18pt;\"><strong><span class=\"x-hidden-focus\">Resources<\/span><\/strong><\/span><\/h2>\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 our July update for Visual Studio Code for Java! In this blog we are going to provide you an exciting update about our improved decompiler functionality. Additionally, we are going to do a deep-dive into our code completion. Let&#8217;s get started! Decompiler Experience Upgrade Java decompiler is essential for understanding third-party [&hellip;]<\/p>\n","protected":false},"author":31999,"featured_media":230036,"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-230000","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 our July update for Visual Studio Code for Java! In this blog we are going to provide you an exciting update about our improved decompiler functionality. Additionally, we are going to do a deep-dive into our code completion. Let&#8217;s get started! Decompiler Experience Upgrade Java decompiler is essential for understanding third-party [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/230000","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=230000"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/230000\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media\/230036"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media?parent=230000"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/categories?post=230000"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/tags?post=230000"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}