Skip to content

The Liberty Config Language Server provides language server features for Liberty server configuration files through any of the supported client IDEs.

License

Notifications You must be signed in to change notification settings

OpenLiberty/liberty-language-server

Repository files navigation

Liberty Config Language Server

Note: Starting with the Liberty LemMinX Language Server 1.0-M1 early release and Liberty Config Language Server 1.0-M1 early release, Java 17 is required.

The Liberty Config Language Server provides language server features for Liberty server configuration files through any of the supported client IDEs. It adheres to the language server protocol.

Client IDEs

The Liberty Config Language Server is included in the following client IDEs.

Supported files

Liberty Config Language Server features are available for the following configuration files.

  • Any XML file that contains a server root element.
  • A server.env file located in a directory specified by the configDirectory configuration in the Liberty Maven or Gradle plugin, or in the default src/main/liberty/config directory.
  • Any file with the extension .env that is specified by the serverEnvFile configuration in the Liberty Maven or Gradle plugin.
  • A bootstrap.properties file located in a directory specified by the configDirectory configuration in the Liberty Maven or Gradle plugin, or in the default src/main/liberty/config directory.
  • Any file with the extension .properties that is specified by the bootstrapPropertiesFile configuration in the Liberty Maven or Gradle plugin.

Features

The following language server features are available through any of the supported client IDEs.

Completion for Liberty server configuration files

Start typing a Liberty property, variable, or XML configuration to view a list of possible options.

  • Completion for Liberty properties and values

Screen capture of Liberty property name suggestions in a bootstrap.properties file Screen capture of value suggestions for a Liberty property in a bootstrap.properties file. If there is a default value, it is preselected.

  • Completion for Liberty variables and values

Screen capture of Liberty variable suggestions in a server.env file Screen capture of value suggestions for a Liberty variable in a server.env file. If there is a default value, it is preselected

  • Completion for Liberty XML configs

Screen capture of Liberty feature suggestions in a feature block in a server.xml file

Hover on Liberty server configuration files

Hover your cursor over Liberty properties, variables, or XML configuration to view a description.

  • Hover for Liberty properties and variables

Screen capture of a documentation dialog appearing when hovering over a Liberty property in a bootstrap.properties file Screen capture of a documentation dialog appearing when hovering over a Liberty variable in a server.env file

  • Hover for Liberty XML configs

Screen capture of feature documentation appearing when hovering over a Liberty feature in a server.xml file

Diagnostics and quick fixes on Liberty server configuration files

Diagnostics highlight potential problems in your configuration, such as invalid values. Quick fixes provide potential solutions to those problems.

  • Diagnostics and quick fixes for Liberty properties and variables

Screen capture showing diagnostics marking an invalid value for a Liberty property in a bootstrap.properties file. Hovering over the diagnostic will provide more details.

Screen capture showing a quick fix for a diagnostic of an invalid value in a bootstrap.properties file. Opening the quick fixes menu will show all the available quick fix options.

Screen capture showing diagnostics marking an invalid value for a Liberty variable in a server.env file. Hovering over the diagnostic will provide more details.

Screen capture showing a quick fix for a diagnostic of an invalid value in a server.env file. Opening the quick fixes menu will show all the available quick fix options.

  • Diagnostics and quick fixes for Liberty XML configs

Screen capture showing diagnostics marking an invalid feature defined in a server.xml file. Hovering over the diagnostic will provide more details.

Screen capture showing a quick fix for a diagnostic on an invalid feature defined in a server.xml file. Hovering over the diagnostic and selecting Quick Fix... will provide more details.

Screen capture showing diagnostics marking an configuration element defined in a server.xml file. Hovering over the diagnostic will provide more details.

Screen capture showing a quick foix for a diagnostics on a configuration element defined in a server.xml file. Hovering over the diagnostic and selecting Quick Fix... will provide more details.

Minimum version recommendations for the Liberty Maven and Gradle plug-ins

It is recommended you always use the latest available version of the Liberty Maven Plug-in or Liberty Gradle Plug-in. Please refer to the release notes for the latest version available for Liberty Maven Plug-in here and Liberty Gradle Plug-in here.

The minimum version recommended is 3.11.4 for Liberty Maven Plug-in and 3.9.4 for Liberty Gradle Plug-in.

If an earlier version is used, the Liberty Config Language Server cannot generate a schema file for use with server.xml editing. As of version 2.3.1 of the Liberty Config Language Server, a default schema that is based on Liberty 25.0.0.6 is used when a schema cannot be generated.

Schema and Feature Validation

If the Liberty Maven Plug-in or Liberty Gradle Plug-in is configured with the Liberty project, the Liberty Config Language Server automatically generates a schema file based on the Liberty runtime and version. This schema file provides relevant information about the supported server.xml elements and Liberty features. If an earlier version of either plug-in is used, the schema file is not regenerated when additional features are installed. This limitation might result in a lack of hover, completion, or diagnostic support for elements related to those newly installed features.

Liberty Tools prioritizes accurate and up-to-date schema and feature validation. While it includes periodically updated cached data, the most reliable validation occurs when you build your project. Building your project allows Liberty Tools to generate schema and feature information directly from the Liberty runtime specified in your project's configuration. This ensures that validation is based on the exact version of Liberty you are using, preventing issues caused by potentially outdated cached data.

How to build your Liberty project:

  • With Maven: Navigate to your project's root directory in your terminal and run:
    mvn clean liberty:run
    For fast, iterative development with automatic hot deployment and on-demand testing, use dev mode:
    mvn liberty:dev
    Refer Goals for more details
  • With Gradle: Navigate to your project's root directory in your terminal and run:
    ./gradlew libertyRun
    For fast, iterative development with automatic hot deployment and on-demand testing, use dev mode:
    ./gradlew libertyDev
    Refer Tasks for more details

For the most accurate validation, always ensure your project has been successfully built.

Contributing

See the DEVELOPING and CONTRIBUTING documents for more details.

License

Eclipse Public License - v 2.0 See LICENSE file.

About

The Liberty Config Language Server provides language server features for Liberty server configuration files through any of the supported client IDEs.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 15

Languages