News

VS Code Gets Java Code Navigation Update, New Code Actions, More

The monthly update to Java on Visual Studio Code sees updated code navigation, new code actions, Java 13 support and more.

The Java functionality in the VS code editor comes from extensions in the tool's marketplace that provide code completion, refactoring, linting, formatting, code snippets, debugging and unit test support, and integrations with tools and frameworks including Maven, Tomcat, Jetty, and Spring Boot.

Here's a look at what's new in the October update, as detailed in an Oct. 18 blog post:

  • Code Navigation -- Go to super implementation -- "You can now keep track of class implementations and overriding methods by clicking the Go to Super Implementation link when hover."
  • Code Actions:
    • -- Create non existing package -- "Now when your package name doesn't match the folder name, you have the options to either change the package name in your code, or move the folder in file system (even when the destination folder doesn't exist yet)."
    • -- Add quick fix for non accessible references -- "This quick fix helps you resolve non accessible reference."
    • -- Automatically trigger auto-import on paste -- "If you paste blocks of code that contain references to classes or static methods and fields that are not yet imported, VS Code now can automatically add missing imports."
  • Refactoring:
    • -- Inline refactoring -- "The Inline refactoring lets you reverse the refactoring for a local variable, method, and constant."
    • -- Convert for-loop to for-each loop -- "The enhanced for-loop is a popular feature. Its simple structure allows you to simplify code by presenting for-loops that visit each element of an array/collection without explicitly expressing how one goes from element to element."
    • -- Convert anonymous class to nested class -- "This refactoring allows you to convert an anonymous class into a named inner class."
    • -- Deprecation tags for symbols and completions -- "Java extension now shows source code that references deprecated types or members with a strike-through line."
  • Code Snippets: "Now VS Code Java supports server side code snippets, which means it will provide more code snippets options in a context aware way."
  • Java 13 support: "Java 13 is out and VS Code is ready for it. It supports Java 13 through latest Java Extension. For developers use Java 12 with preview features, you will need to upgrade to JDK 13 to keep working with them."
  • Debugger: -- Show Run/Debug when hover -- "In case you don't like the Run/Debug button on the Code Lens of your main method, but still want easy access to the functionality, you can now configure to disable the Code Lens but still accessible by hover."
  • Maven Support: -- Resolve unknown type -- "Maven extension now supports searching Maven Central to resolve unknown type in your code. You can achieve this easily by clicking the link in hover."
  • Checkstyle:
    • -- Enhanced setting configuration command -- "Checkstyle: Set the Checkstyle Configuration command will now detect potential Checkstyle configuration files and list them. You can also provide a configuration file by directly writing a URL in the input box now."
    • -- Setting checkstyle version support -- "A new command Checkstyle: Set the Checkstyle Version is added to the extension."

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus

Featured

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube