Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 348473

Summary: The formatter:on / formatter:off keywords get ignored
Product: [Eclipse Project] JDT Reporter: CommodoreFabianus
Component: CoreAssignee: Ayushman Jain <amj87.iitr>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: amj87.iitr
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description CommodoreFabianus CLA 2011-06-06 16:27:01 EDT
Build Identifier: 20110218-0911

I tried to disable the formatter for few lines:
    private static boolean checkOpaqueMaterials(Material... materials) {
        // TODO: Reorganize
        // @formatter:off
        return checkMaterials(materials,
               ....
        // @formatter:on
    }

But the formatter ignores this, and formats the complete area.

Reproducible: Always

Steps to Reproduce:
1. Create code like the posted above.
2. Format the file or selected text (including the disabled area)
3. The formatter will format every line.
Comment 1 Ayushman Jain CLA 2011-06-07 02:02:05 EDT
I cannot reproduce this using 3.7RC4 build. Can you please provide a specific code snippet? Please also attach your formatter profile (export from the preferences page).

Btw, just to make sure, you have the "enable off/on tags" option checked in the formatter preferences and the tags configured as @formatter:on/off, right? This option is disabled by default.
Comment 2 CommodoreFabianus CLA 2011-06-07 05:12:39 EDT
Okay sorry, but didn't know, that there was an option to enable.

Fabian