eclipse / lsp4mp

Technology lsp4mp
Eclipse Public License 2.0
21 stars 27 forks source link

Property value validation as expression vs. literal should be guarded by "${..}" not merely by a single '$' character #440

Open scottkurz opened 3 months ago

scottkurz commented 3 months ago

In https://github.com/OpenLiberty/liberty-tools-eclipse/issues/501, with LSP4MP v0.10.0, we see a validation error with a microprofile-config.properties property:

mp.messaging.outgoing.systemLoad.value.serializer=io.openliberty.guides.models.SystemLoad$SystemLoadSerializer

Looking at the code: https://github.com/eclipse/lsp4mp/blob/302b7a12737de3180eb6d0cf009e8c6a7323ad99/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/model/parser/PropertiesParser.java#L173-L189

it seems our parser "state machine" switches over to assuming a property expression substitution upon seeing a single '$' character, looking for something like:

prop2=${prop1}

It seems we might need to rework it to look for "${" before assuming a property expression substitution.

That is more complicated parsing, but will stop there having identified the problem.