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

Bug 407252

Summary: [Formatter] The off tag is not respected at block comments
Product: [Eclipse Project] JDT Reporter: Oliver Kopp <oliver.kopp>
Component: CoreAssignee: Mateusz Matela <mateusz.matela>
Status: CLOSED DUPLICATE QA Contact:
Severity: minor    
Priority: P3 CC: mateusz.matela, oliver.kopp, the.ubik
Version: 4.2.2   
Target Milestone: 4.8 M5   
Hardware: PC   
OS: Windows 8   
Whiteboard: To be verified for 4.8 M5

Description Oliver Kopp CLA 2013-05-06 03:21:55 EDT
The @formatter:off tag is not respected in block comments:

	/**
	 * @formatter:off
	 * This line gets moved
	 * @formatter:on
	 */
	public static void test() {
	}

gets

	/**
	 * @formatter:off This line gets moved
	 * @formatter:on
	 */
	public static void test() {
	}
Comment 1 Palmer Eldritch CLA 2013-12-17 08:16:49 EST
It is not only inside block comments :

class Test {
	
	// formatter:off
	/*
	private void meth() {
		// this will wrap
	}
	*/
}

Ctrl+shift+F

class Test {
	// formatter:off
	/*
	 * private void meth() { // this will wrap }
	 */
}

Should I fill a new one (as I intended originally) ?
Comment 2 Mateusz Matela CLA 2018-01-02 16:28:09 EST
I've checked both cases and they work correctly now (except that Palmer used "formatter:off" instead of "@formatter:off"), probably since the formatter rewrite in Eclipse Mars.

*** This bug has been marked as a duplicate of bug 303519 ***