Can't determine why intelliJ is moving my comment to a new line

已回答

I have save action and code format enabled, so I understand literally why the line is moving. It's because I have auto-format enable and it is auto-formatting the code. 

Yet, I have no idea how to tell the IDE "please, stop doing this!"

The example is simple, I have a mapstruct mapping, and I want to put a comment after it (not above, not below)

@Mapping(target = "whatever", ignore = true) // TODO discuss how to implement Whatever
Target toTarget(Source s);

This is how I would like it to look, below is how the auto correct messes it up:

@Mapping(target = "whatever", ignore = true)
// TODO discuss how to implement Whatever
Target toTarget(Source s);

I have wrapping at 120, but this only reaches 91 characters. So it's not that.

I have no idea what other setting would force this.

0

Could you share the IDE settings and the logs folder zipped? Files can be uploaded at https://uploads.jetbrains.com (do not forget to specify the UploadID here)

Try to temporarily disable all third-party plugins.

Thank you!

0

Upload id: 2022_09_23_iqiQXt47JxwHRpksqyr5Af (files: settings.zip and 3 more)

0

Thank you! I reproduced this behaviour and reported the issue for the responsible developer in YouTrack. Please follow https://youtrack.jetbrains.com/issue/IDEA-302357 for updates.

See https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications if you're not familiar with YouTrack.

1

Please try to set 'Preferences | Editor | Code Style | Java | Wrapping and Braces | Method annotations' to 'Do not wrap'

Does it help?

0

Yep, that was the option that I was looking for, everything works.

/issue/IDEA-302357  should probably be closed.

0

请先登录再写评论。