rewrite icon indicating copy to clipboard operation
rewrite copied to clipboard

MergeYamlVisitor - inline comments not taken into account

Open thomaszub opened this issue 3 years ago • 0 comments

Hi,

the MergeYamlVisitor does not take inline comments into account at merging YAMLs. See the test:

@Test
fun existingEntryBlockWithComment() = assertChanged(
    recipe = MergeYaml(
        "$",
        """
            spring:
              application:
                description: a description
        """.trimIndent(),
        false,
        null
    ),
    before = """
        spring:
          application:
            name: main #Some comment
    """,
    after = """
        spring:
          application:
            name: main #Some comment
            description: a description
    """
)

The actual result is:

spring:
  application:
    name: main
    description: a description #Some comment

Thanks and kind regards Thomas

thomaszub avatar Sep 14 '22 11:09 thomaszub