Skip to content

Wrapped comments are missing the \\ prefix #1922

Open
@dalewking

Description

@dalewking

Describe the bug
When adding a comment that has long text that is long enough to wrap, additional lines are indented and do not have the \ at the beginning

To Reproduce

val reallyLongLine = "This is a really long line of text that will have to be wrapped when it is used in a comment because it is so long"

someFileSpec.addFileComment("%L", reallyLongLine)

which produces this file comment:

// This is a really long line of text that will have to be wrapped when it is used in a comment
        because it is so long

Expected behavior
It should produce this file comment:

// This is a really long line of text that will have to be wrapped when it is used in a comment
// because it is so long

Additional context
I believe the issue are these 2 lines, which should probably be something more like this:

          indentLevel = if (kdoc || comment) indentLevel else indentLevel + 2,
          linePrefix = if (kdoc) " * " else if (comment) "// " else "",

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions