Skip to main content
HelidonLSP4MPMicroProfile CommunityOpen LibertyQuarkus

Announcement: Language Server for MicroProfile and the Tools for MicroProfile VS Code extension

By September 25, 2020No Comments

We are happy to announce the first release of the Language Server for MicroProfile (LSP4MP) and the Tools for MicroProfile VS Code extension.  LSP4MP is a language server that provides core language support for MicroProfile, including code complete, diagnostics, snippets and more. Tools for MicroProfile leverages LSP4MP to provide a rich VS Code editing experience for developers. Tools for MicroProfile works with your favorite MicroProfile runtimes, such as Quarkus, Open Liberty, and Helidon.

LSP4MP is based on the Language Server Protocol, an open source specification that standardizes the way language servers communicate with editors and IDEs. Language servers provide language-specific knowledge and power language features such as completion, diagnostics, and hover. Through the Language Server Protocol, a single language server can be re-used in multiple IDEs and editors with minimal effort.

Tools for MicroProfile works together with LSP4MP to provide language support in VS Code for both microprofile-config.properties files and Java files.

In microprofile-config.properties files, Tools for MicroProfile provides the following features for MicroProfile properties:
– Completion
– Hover
– Definition support
– Formatting support
– Validation and Quick Fixes
– Outline support (flat or tree view)

In Java files, Tools for MicroProfile provides MicroProfile-specific support for the following features :
– Completion
– Hover
– Validation and Quick Fixes
– Code Lens support
– Code snippets

LSP4MP is an open source project that welcomes any and all contributions. The project originated from Red Hat’s Quarkus Language Server, with contributions from IBM. If you have ideas for new MicroProfile language features, you can open an issue on the project’s issue tracker or chat with us in the Gitter room for LSP4MP.

Requirements

Tools for MicroProfile requires the Language Support for Java (TM) by Red Hat extension and a minimum JDK of Java 11. For more information about the minimum JDK requirements, see About Upgrading to Java 11 for VS Code for Java.

Installing the extension

You can install Tools for MicroProfile for VS Code from the Visual Studio Marketplace.
For other VS Code-compatible editors, you can install it from Open VSX.

Feature overview

Tools for MicroProfile enhances your MicroProfile development experience with the following features:

Hover documentation for microprofile-config.properties

With Tools for MicroProfile, you can easily view documentation for MicroProfile config properties by hovering over the property key.

Config property hover documentation
Completion for MicroProfile config properties

You can use the Ctrl+Space (⌥+Space for macOS) keyboard shortcut to list completion options. Eclipse LSP4MP uses ConfigProperty annotations and classpath information to show only the MicroProfile config properties available to your project.

Config property completion

Validation for MicroProfile config properties

Tools for MicroProfile also displays validation for MicroProfile config properties, which detects unknown properties, duplicate properties, and incorrect data types.

Config property diagnostics
Java Snippets for MicroProfile APIs

Tools for MicroProfile provides snippets for several MicroProfile APIs including JAX-RS resources, MicroProfile health checks, and frequently used MicroProfile annotations.

Java snippets
Diagnostics and Quick Fixes for MicroProfile Java files

Tools for MicroProfile can detect and display warnings for incorrect usages of MicroProfile APIs and provide Quick Fixes.

Java diagnostic messagesJava diagnostic messages
Hover support for MicroProfile config properties in Java files

When you hover over a config property in Java code, the value of the property that is defined in your microprofile-config.properties file is displayed.

Hover in Java files for Config Properties
CodeLens support for MicroProfile Rest Client

When you use MicroProfile Rest Client,  CodeLens shows the full REST endpoint path.

VSCode Codelens support

More to come, join the conversation!

The roadmap for Tools for MicroProfile and Eclipse LSP4MP includes improved support for MicroProfile APIs, new code snippets, and more. If you have any issues or feature requests, please let us know by creating a GitHub issue. We welcome and value any feedback or ideas. If you are interested in contributing to either vscode-microprofile or Eclipse LSP4MP, check out these contributing guides:
VS Code MicroProfile contribution guide
LSP4MP contribution guide

See also

VS Code Marketplace
Open VSX Registry
eclipse/lsp4mp: Github | Gitter
redhat-developer/vscode-microprofile:  GitHub | Gitter

Ryan Zegray

Author Ryan Zegray

Ryan Zegray is a Software Developer at IBM. He works on Developer Experience for Eclipse MicroProfile and Open Liberty and is a committer for the Eclipse LSP4MP project.

More posts by Ryan Zegray

Leave a Reply