A MicroProfile project can be configured using a microprofile-config.properties
file. vscode-microprofile provides a variety of support for microprofile-config.properties
files.
These features are made available given a "Microprofile properties" file has been detected.
These features are also supported for a user profile on the config level and the property level. For example, a file such as microprofile-config-prod.properties
will have feature support in relation to the prod
profile.
Depending on the extensions installed for the project, the property autocomplete feature lists suggested properties based on the text entered and extensions available.
Value completion is also supported for each property.
You can find out more on the available extensions and the completion supported for your MicroProfile project version at microprofile.io.
For any given supported property defined in microprofile-config.properties
, hovering the property will list details about the property, including type, associated extension and assigned value, if any.
If a property value is configured in microprofile-config.properties
, Ctrl + Click
of the property will jump to the Java file declaration.
If a property value is defined using a property expression (i.e. ${}
) which references another property defined in microprofile-config.properties
, Ctrl + Click
of the property expression value will jump to the property definition.
A "Microprofile properties" file sets the default formatter to "Tools for MicroProfile", so the formatting shortcut for a microprofile-config.properties
file is Ctrl + Shift + I
. The formatter can also be accessed from the command palette and right-click dropdown.
For any supported property that can be defined in a "Microprofile properties" file, there is validation for the property name and a quick fix action to correct the diagnostic.
Given the following microprofile-config.properties
file:
mp.metrics.appName=foo
mp.metrics.tags=bar
With the microprofile.tools.symbols.showAsTree
setting enabled:
The property hierarchy can be viewed from the "Outline" tab.