You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Recognise !--- as a document separator in properties files #1129
Expected Behaviour
In properties files, !--- and #--- can both be used to separate documents (as long as there's no neighbouring comment with the same prefix). The editor should recognise this when parsing properties files.
E.g. the following properties file should show an error about duplicate properties def, but not abc:
abc=1
!---
abc=2
def=3
#---
# some comment
def=4
Current Behaviour
With the properties file, above, the editor raises errors for duplicate properties abc, and not def, because it does not recognise !--- as a document separator, and it does not take notice of the # some comment line "cancelling" the #--- separator.
Context
This causes unnecessary errors to show up in the problems view, and also causes actual errors to not appear.
@pmahony893 I didn't see !--- and #--- to be mentioned in the Oracle's Java Properties spec at all. Are you sure you are not confusing Java Properties format with YAML? YAML format properties can have the above doc separators but doesn't look like Java Properties format can have doc separators... Ultimately contents of the Java Properties file land in java.util.Properties type object which is really a wrapper around a map.
@BoykoAlex I'm referring to the Spring Boot feature described here, whereby a properties file may be split into multiple documents, similar to yaml files.
There is already some editor support for this, however, it is incomplete, as only the # variant is recognised, and comments on neighbouring lines are not taken into account.
@pmahony893 I see - thanks for sharing the link to the doc. Looks like we need to extends the Java Properties Grammar and parser to handle this... There are other tools that work with application.properties files, i.e. OpenRewrite recipes which also unlikely to recognize this new feature...
Activity
BoykoAlex commentedon Nov 8, 2023
@pmahony893 I didn't see
!---and#---to be mentioned in the Oracle's Java Properties spec at all. Are you sure you are not confusing Java Properties format with YAML? YAML format properties can have the above doc separators but doesn't look like Java Properties format can have doc separators... Ultimately contents of the Java Properties file land injava.util.Propertiestype object which is really a wrapper around a map.pmahony893 commentedon Nov 8, 2023
@BoykoAlex I'm referring to the Spring Boot feature described here, whereby a properties file may be split into multiple documents, similar to yaml files.
There is already some editor support for this, however, it is incomplete, as only the # variant is recognised, and comments on neighbouring lines are not taken into account.
BoykoAlex commentedon Nov 8, 2023
@pmahony893 I see - thanks for sharing the link to the doc. Looks like we need to extends the Java Properties Grammar and parser to handle this... There are other tools that work with
application.propertiesfiles, i.e. OpenRewrite recipes which also unlikely to recognize this new feature...BoykoAlex commentedon Jul 26, 2024
Fixed with 32c8a86