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

  • Hands On: New VS Code Insiders Build Creates Web Page from Image in Seconds

    New Vision support with GitHub Copilot in the latest Visual Studio Code Insiders build takes a user-supplied mockup image and creates a web page from it in seconds, handling all the HTML and CSS.

  • Naive Bayes Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the naive Bayes regression technique, where the goal is to predict a single numeric value. Compared to other machine learning regression techniques, naive Bayes regression is usually less accurate, but is simple, easy to implement and customize, works on both large and small datasets, is highly interpretable, and doesn't require tuning any hyperparameters.

  • VS Code Copilot Previews New GPT-4o AI Code Completion Model

    The 4o upgrade includes additional training on more than 275,000 high-quality public repositories in over 30 popular programming languages, said Microsoft-owned GitHub, which created the original "AI pair programmer" years ago.

  • Microsoft's Rust Embrace Continues with Azure SDK Beta

    "Rust's strong type system and ownership model help prevent common programming errors such as null pointer dereferencing and buffer overflows, leading to more secure and stable code."

  • Xcode IDE from Microsoft Archrival Apple Gets Copilot AI

    Just after expanding the reach of its Copilot AI coding assistant to the open-source Eclipse IDE, Microsoft showcased how it's going even further, providing details about a preview version for the Xcode IDE from archrival Apple.

Subscribe on YouTube

Upcoming Training Events