OpenLiberty / liberty-tools-intellij

IntelliJ IDEA extension for Liberty
https://plugins.jetbrains.com/plugin/14856-open-liberty-tools
Eclipse Public License 2.0
12 stars 24 forks source link

LCLS: server.env expansion variables are being treated as escape characters #251

Open kathrynkodama opened 1 year ago

kathrynkodama commented 1 year ago

Due to https://github.com/OpenLiberty/liberty-tools-intellij/pull/249, server.env files are being syntax highlighted as properties files - resulting in expansion variables using \ being treated as escape characters. image

More on expansion variables in server.env files: https://www.openliberty.io/docs/latest/reference/config/server-configuration-overview.html#exp-var-windows

mrglavas commented 2 months ago

When I add these variables to server.env:

IBM_DIR=!ProgramFiles!\IBM
JAVA_HOME=!IBM_DIR!\java
WLP_USER_DIR=!USERPROFILE!\wlp-usr

and start the Liberty server using the current LTI development branch (which uses LSP4iJ 0.0.2) it appears to resolve the JAVA_HOME directory correctly.

image

Note that C:\Program Files\IBM\java\bin\java doesn't exist on my system, but would be a valid path if I had installed Java at that location.

In the editor I'm still seeing the highlighting of "escape sequences" that Kathryn had observed, but this seems to only be colouring in the IDE and not impactful to the actual processing of server.env which appears to be working correctly. I'd consider this a minor issue, misleading to someone typing in the editor but doesn't break usage of server.env.

image