Bug 305371 - [formatter] Unexpected indentation of line comment
Summary: [formatter] Unexpected indentation of line comment
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M7   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-10 13:22 EST by Frederic Fusier CLA
Modified: 2010-04-26 08:59 EDT (History)
3 users (show)

See Also:


Attachments
Proposed patch (5.76 KB, patch)
2010-03-16 06:10 EDT, Frederic Fusier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Fusier CLA 2010-03-10 13:22:11 EST
Using I20100309-0809.

The following snippet:
class Example {
//  unformatted    comment    !
		//  formatted    comment    !
}

When deselecting the preference "Format line comments on first column", I get the following unexpected output:
class Example {
//  unformatted    comment    !
// formatted comment !
}

Instead, I would expect:
class Example {
//  unformatted    comment    !
	// formatted comment !
}
Comment 1 Frederic Fusier CLA 2010-03-10 13:25:24 EST
The following snippet with the same option:
class Example {
//  unformatted    comment    !

		//  formatted    comment    !
}

is well formatted:
class Example {
//  unformatted    comment    !

	// formatted comment !
}

Note the empty line between the comments...
Comment 2 Frederic Fusier CLA 2010-03-16 06:10:39 EDT
Created attachment 162152 [details]
Proposed patch

With this patch the formatter now considers that two consecutive comments are not contiguous when one of them is on first column and the preference to format this kind of comment is deactivated.
Comment 3 Frederic Fusier CLA 2010-03-16 06:11:13 EDT
Released for 3.6M7 in HEAD stream.
Comment 4 Satyam Kandula CLA 2010-04-26 05:56:05 EDT
Verified for 3.6M7 using build I20100424-2000