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 at Converge 360.

comments powered by Disqus

Featured

  • Get Started Using .NET Aspire with SQL Server & Azure SQL Database

    Microsoft experts are making the rounds educating developers about the company's new, opinionated, cloud-ready stack for building observable, production ready, distributed, cloud-native applications with .NET.

  • 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.

Subscribe on YouTube