Skip to content

Configuration Properties Editor

Alessandro Falappa edited this page Jun 28, 2017 · 12 revisions

The plugin recognizes Spring Boot configuration properties files and opens them in a specific editor.

Recognized file name patterns are:

  • application.properties and application-<profile>.properties
  • bootstrap.properties and bootstrap-<profile>.properties

The configuration properties file editor has an extended syntax highlighting, configurable error highlighting and provides completion for configuration properties names and values together with documentation. Completion lists and documentation are obtained by processing of standard Spring Boot configuration metadata.

See it in action here.

Syntax highlighting

The extended syntax highlighting colorizes dot separated keys and key array notation.

You can configure colors choosing Tools > Options and selecting in the Fonts & Colors tab the Spring Boot Configuration Properties language:

Error highlighting

Error highlighting is shown for:

  • syntax errors: such as wrong array notation, misplaced comments, unescaped special characters.
  • duplicates: repeating properties are flagged, by default, as warnings.
  • data type mismatches: configuration properties values are checked against the data type declared in the metadata and if the value string cannot be converted it is flagged as an error.

Note: data type mismatch only supports the most common data type conversions (for instance does not detect and make use of Spring converters declared in the project), if you think some important data type conversion is missing open an enhancement issue. Note: contrary to standard Java Properties notation where keys can be separated from values by whitespace, the configuration editor flags as syntax error the absence of a : or = separator.

Properties name completion

Properties names are completed trough a substring search. Documentation of the currently selected property in the completion list is shown.

Properties value completion

Property values from the hints attribute in spring configuration metadata are completed when completion is invoked after an equal sign.

Custom properties support

If the spring-configuration-processor has been added as a maven dependency to the project, for example trough the maven code generator provided by the plugin, Spring configuration properties metadata is also generated for @ConfigurationProperties classes in the project and used to provide completion and documentation for user defined properties.

To provide lists of allowed values for user defined properties create an additional-spring-configuration-metadata.json file in the /META-INF subdirectory of the project.

Clone this wiki locally