Bug 305131 - [formatter] Be able to reverse the code formatter disabling logic
Summary: [formatter] Be able to reverse the code formatter disabling logic
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-09 07:02 EST by Baptiste Mathus CLA
Modified: 2010-03-09 08:39 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Baptiste Mathus CLA 2010-03-09 07:02:43 EST
Build Identifier: I20100307-2000

The evolution https://bugs.eclipse.org/27079 now lets us disable formatter for selected parts of the code. 

But currently, the logic is the following: 
* at the beginning of the file, the formatter is enabled
* then it can be disabled/reenabled when encountering Off/On tags.

To sum up, the current principle is that the main part of the file has to be formatted, and to be disabled selectively.

This can be a problem, when in the contrary you mainly want not to format the file, and only selected parts have to be formatted.

There's currently one workaround: put a Off tag at the beginning of the file, and a On tag at the beginning of the "to be formatted" parts. 

But I feel it would be a bit more natural if one could define the default formatting behaviour (format, or no), and then define the part that have to be formatted.

Cheers.


Reproducible: Always