Bug 559383 - [clean up][save action] Remove trailing whitespace and Correct indentation should pay attention to format edited lines option
Summary: [clean up][save action] Remove trailing whitespace and Correct indentation sh...
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.14   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-21 14:53 EST by Thomas Watson CLA
Modified: 2024-01-03 08:00 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Watson CLA 2020-01-21 14:53:29 EST
Preferences -> Java Editor -> Save Actions

When configuring the save action for "Format source code" there are two options

 * Format all lines
 * Format edited lines

If one selects "Format edited lines" then only the edited lines are formatted according to the configured formatter.  But under "Additional actions" -> "Code Organizing" there seems to be additional Formatter options for:

 * Remove trailing whitespace
 * Correct indentation

If one of these are used and you save an editor's content then these formatting rules from "Additional actions" are applied to the complete content even though the user configured the format source code option to apply to only the edited lines.  From my user perspective I would expect all formatting actions to be controlled by the option to limit formatting to edited lines only.
Comment 1 Eclipse Genie CLA 2022-01-11 01:49:52 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 2 Eclipse Genie CLA 2024-01-03 08:00:18 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.