Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 348473 - The formatter:on / formatter:off keywords get ignored
Summary: The formatter:on / formatter:off keywords get ignored
Status: CLOSED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Ayushman Jain CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-06 16:27 EDT by CommodoreFabianus CLA
Modified: 2011-06-07 05:12 EDT (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 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