Open garretwilson opened 1 year ago
Hi @garretwilson I recently made a fix in this area with text blocks used as arguments and when I try a sample piece of code which calls a method with multiple strings, I don't see the code change between CTRL+Shift+F and CTRL+S so is possible my recent changes fix this. If you want to test, go to: https://download.eclipse.org/eclipse/downloads/ and click the build starting with I2023 and download the SDK for your platform. You can then try and run some tests to verify it is fixed.
Hi, @jjohnstn . Thanks for replying. Since this is not a huge impediment to my work, I'll just wait until the next release before testing it. The biggest thing is knowing that someone cares and looked into it. I appreciate it! I'll circle back and let you know if this bug is still hanging around after the next release.
This sort of issue seems to keep coming back; see e.g. Bug 560889 and similar (but opposite) Bug 563487.
I'm using Eclipse EE 2023-03 on Windows 10 with Java 17. I have custom formatting settings with a line wrapping max line width set to
160
. I'm using tab indention with a display of2
spaces per tab. In addition in the preferences under Java > Editor > Save Actions I have:[x]
Perform the selected actions on save[x]
Format source code(x)
Format edited linesI enter the following method:
The
"""
starts a Java text block.FooBarThingRepository
line.Ctrl+Shift+F
to format the code, and it looks fine.Ctrl+S
to safe the file, and Eclipse reformats it to this:Eclipse has moved the start of the text block
"""
to another line. This has neither rhyme nor reason.160
I have defined.Ctrl+Shift+F
. Why should it format them again, and format them differently?I can only guess there is some duplicated-but-diverging code between the entire document format and the format-when-save logic.
I can work around this by using
Ctrl+Z
after saving and then saving again. But once I edit that line again, I have to go through the same dance.