Home

Awesome

Tools for MicroProfile

Visual Studio Marketplace Installs Chat Build Status License

Description

This Visual Studio Code extension provides support for the development of MicroProfile®-based applications, via the LSP4MP project, which consists of:

MicroProfile properties Features

In microprofile-config.properties files, you will benefit with:

MicroProfile Java Features

In Java files, you will benefit with:

Requirements

Supported VS Code settings

The following settings are supported:

Note for MicroProfile Rest Client properties:

Due to this issue, the MP Rest property: <mp-rest-client-class>/mp-rest/providers/<mp-rest-provider-class>/priority reports an unknown error.

To avoid having this error, you must configure the following in settings.json:

"microprofile.tools.validation.unknown.excluded": [
    "*/mp-rest/providers/*/priority"
]

This settings is set by default.

Extending Tools for MicroProfile

By default, Tools for MicroProfile provides:

The support for properties and java files can be extended with:

To contribute these features, you must create a vscode-extension that declares the microprofile contributions in its package.json. These contributions will be picked up automatically by vscode-microprofile when it starts up the language server.

"contributes": {
  "microprofile": {
    "jarExtensions": [...],
    "documentSelector": [...],
  }
}

Contributing to properties and Java support

LSP4MP can be extended to support custom completion, hover, validation, etc by using the Java Service Provider Interface (SPI). vscode-microprofile provides the ability to use your custom lsp4mp extension by contributing external JARs to the classpath of lsp4mp.

To contribute an external JAR you must create a vscode extension which embeds your lsp4mp extension JAR and declares the path to your JAR in the extensions package.json

"contributes": {
  "microprofile": {
    "jarExtensions": [
      "./jar/com.demo.custom-lsp4mp-extension.jar"
    ]
  }
}

For an example of how this can be used you can look at vscode-quarkus and the quarkus-ls lsp4mp extension. vscode-quarkus contributes an external jar which provides additional language support for quarkus properties and java files.

Contributing to MicroProfile Language / Document Selector support

It is also possible to contribute additional document selectors which are used to register additional file types / languages with the lsp4mp language server

"contributes": {
  "microprofile": {
    "documentSelector": [
      {
        "scheme": "file",
        "language": "my-custom-properties"
      }
    ]
  }
}

For an example of how this can be used you can look at vscode-quarkus which contributes a document selector for Quarkus's application.properties file in order to provide MicroProfile/Quarkus properties support in this file.

Telemetry

With your approval, vscode-microprofile extension collects anonymous usage data and sends it to Red Hat servers to help improve our products and services. Read our privacy statement to learn more. This extension respects the redhat.telemetry.enabled setting, which you can learn more about at https://github.com/redhat-developer/vscode-redhat-telemetry#how-to-disable-telemetry-reporting Note that this extension abides by Visual Studio Code's telemetry level: if telemetry.telemetryLevel is set to off, then no telemetry events will be sent to Red Hat, even if redhat.telemetry.enabled is set to true. If telemetry.telemetryLevel is set to error or crash, only events containing an error or errors property will be sent to Red Hat.

Contributing

This is an open source project open to anyone. Contributions are extremely welcome!

For information on getting started, refer to the CONTRIBUTING instructions.

CI builds can be installed manually by following these instructions:

  1. Download the latest development VSIX archive from here. (vscode-microprofile-XXX.vsix)

  2. Click View/Command Palette

  3. Type 'VSIX'

  4. Select 'Install from VSIX...' and choose the .vsix file.

Feedback

Please report bugs, issues and feature requests by creating a GitHub Issue.

License

Apache License 2.0. See LICENSE file.

MicroProfile® and the MicroProfile logo are trademarks of the Eclipse Foundation