Skip to content

Multiline TODO formatting is incorrect #1108

Open

Description

@ColtonIdle

Transplanting this issue Kotlin/ktfmt#239

Activity

  1. cushon commented on Jul 20, 2024

    @cushon
    Collaborator

    To confirm, it sounds like the report is that given a TODO like:

    // TODO: We still have a lot of work to do here. We still have a lot of work to do here. We still have a lot of work to do here. We still have a lot of work to do here.
    

    ... the formatter will wrap it to two lines like this:

    // TODO: We still have a lot of work to do here. We still have a lot of work to do here. We still
    // have a lot of work to do here. We still have a lot of work to do here.
    

    And IntelliJ has a feature that recognize multi-line TODOs and highlights them, but only if the following lines have additional indentation, and you would like the formatter to do that automatically?

      // TODO: We still have a lot of work to do here. We still have a lot of work to do here. We still
    - // have a lot of work to do here. We still have a lot of work to do here.
    + //  have a lot of work to do here. We still have a lot of work to do here.

    Note that the formatter won't change // comments in this way unless there longer than the column limit, so if there are existing comments with the extra space that don't need wrapping it will leave them alone.

  2. ColtonIdle commented on Jul 20, 2024

    @ColtonIdle
    Author

    Yeah, that sounds right to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions