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

  • Mastering Blazor Authentication and Authorization

    At the Visual Studio Live! @ Microsoft HQ developer conference set for August, Rockford Lhotka will explain the ins and outs of authentication across Blazor Server, WebAssembly, and .NET MAUI Hybrid apps, and show how to use identity and claims to customize application behavior through fine-grained authorization.

  • Linear Support Vector Regression from Scratch Using C# with Evolutionary Training

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the linear support vector regression (linear SVR) technique, where the goal is to predict a single numeric value. A linear SVR model uses an unusual error/loss function and cannot be trained using standard simple techniques, and so evolutionary optimization training is used.

  • Low-Code Report Says AI Will Enhance, Not Replace DIY Dev Tools

    Along with replacing software developers and possibly killing humanity, advanced AI is seen by many as a death knell for the do-it-yourself, low-code/no-code tooling industry, but a new report belies that notion.

  • Vibe Coding with Latest Visual Studio Preview

    Microsoft's latest Visual Studio preview facilitates "vibe coding," where developers mainly use GitHub Copilot AI to do all the programming in accordance with spoken or typed instructions.

  • Steve Sanderson Previews AI App Dev: Small Models, Agents and a Blazor Voice Assistant

    Blazor creator Steve Sanderson presented a keynote at the recent NDC London 2025 conference where he previewed the future of .NET application development with smaller AI models and autonomous agents, along with showcasing a new Blazor voice assistant project demonstrating cutting-edge functionality.

Subscribe on YouTube