News

Java on VS Code: More Snippet Shortcuts, Optimized Code Completion

The regular monthly update to Java on Visual Studio Code sees added shortcut snippets aligning with other editors, optimized code completion, improvements to the Maven build automation tool and more pre-release version of extensions.

Microsoft's Java on Visual Studio Code dev team maintains extensions, including the Extension Pack for Java (12 million installs), which bundles six individual extensions that provide the VS Code Java experience.

In this cycle, the team added more code-completion shortcuts to generate code snippets, which were based on the Eclipse convention because Java-specific functionality comes from the Eclipse JDT Language Server.

Developer feedback indicated developers would like to see shortcut schemes from other IDEs be available too, since they are familiar. So Microsoft added shortcuts for the popular IntelliJ IDEA offering. That means Eclipse-style shortcuts like sysout (for System.out.println()) and syserr (for System.err.println()) are matched with IDEA-style shortcuts sout and serr.

See the new functionality at work in this animated graphic:

Snippet Shortcut Demo
[Click on image for larger, animated GIF view.] Snippet Shortcut Demo (source: Microsoft).

Following the code-completion theme, the team also optimized that functionality when used with the new keyword to create constructors in another reaction to developer feedback, this time requesting a little more awareness about the type being defined. "For example, a List<String> will result in a suggestion for new ArrayList<String>. Similarly, a String[] will result in a suggestion of an array type to complete the constructor," said Nick Zhu, senior program manager, in a March 21 blog post.

Code completion is yet again part of another improvement, this one to the Maven build automation tool, which received a couple tweaks. One presents a full Maven POM file path in a tooltip when a coder hovers over the main node in the Maven extension view. Another is a fix such that auto completing a Maven dependency version will replace the existing text instead of adding the new text onto it.

Finally, the team has continued to enable more extensions to be available in pre-release versions so developers can put the bits through their paces early. Now enabled are Gradle for Java and Maven for Java extensions, with the remaining extensions planned to be available in pre-release versions by the end of this month.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Microsoft Revamps Fledgling AutoGen Framework for Agentic AI

    Only at v0.4, Microsoft's AutoGen framework for agentic AI -- the hottest new trend in AI development -- has already undergone a complete revamp, going to an asynchronous, event-driven architecture.

  • IDE Irony: Coding Errors Cause 'Critical' Vulnerability in Visual Studio

    In a larger-than-normal Patch Tuesday, Microsoft warned of a "critical" vulnerability in Visual Studio that should be fixed immediately if automatic patching isn't enabled, ironically caused by coding errors.

  • Building Blazor Applications

    A trio of Blazor experts will conduct a full-day workshop for devs to learn everything about the tech a a March developer conference in Las Vegas keynoted by Microsoft execs and featuring many Microsoft devs.

  • Gradient Boosting Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the gradient boosting regression technique, where the goal is to predict a single numeric value. Compared to existing library implementations of gradient boosting regression, a from-scratch implementation allows much easier customization and integration with other .NET systems.

  • Microsoft Execs to Tackle AI and Cloud in Dev Conference Keynotes

    AI unsurprisingly is all over keynotes that Microsoft execs will helm to kick off the Visual Studio Live! developer conference in Las Vegas, March 10-14, which the company described as "a must-attend event."

Subscribe on YouTube