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

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube