Files
openide/java/java-tests/testData/properties/addcomment/beforeAddCommentToFirstProperty.properties
Nikita Eshkeev 5b5caf37a3 [properties] IDEA-248873 - Cannot programmatically add comments to properties file
PropertiesParserDefinition.spaceExistenceTypeBetweenTokens didn't use to check if the left node is a comment and always returned SpaceRequirements.MAY, which resulted in merging newly added comment with the property the comment is for.

This patch adds a check if the left node is a comment and if so the method returns SpaceRequirements.MUST_LINE_BREAK which forces IDEA insert a newline between newly created comment and the property the comment is for

Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com>

GitOrigin-RevId: 703548e456b129f01486c8f5a5775923002a336c
2020-10-20 22:08:15 +00:00

3 lines
47 B
Properties

# " the first words" "true"
<caret>hello=world