Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiline TODO formatting is incorrect #1108

Open
ColtonIdle opened this issue Jun 6, 2024 · 2 comments
Open

Multiline TODO formatting is incorrect #1108

ColtonIdle opened this issue Jun 6, 2024 · 2 comments

Comments

@ColtonIdle
Copy link

Transplanting this issue facebook/ktfmt#239

@cushon
Copy link
Collaborator

cushon commented Jul 20, 2024

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.

@ColtonIdle
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants