Summary: | [formatter] 3.3 Code Formatter repeatedly indents block comment | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | trent cobham <trent> | ||||||
Component: | Core | Assignee: | Frederic Fusier <frederic_fusier> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P3 | CC: | benno.baumgartner, jarthana | ||||||
Version: | 3.3 | ||||||||
Target Milestone: | 3.5 M6 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows XP | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
trent cobham
2007-08-06 13:32:45 EDT
I forgot to say it worked ok in Eclipse 3.2 - inasmuch as it formatted the code only once to leave a 4-space indent before the last lines of the block comment: int x = 0; /* * For */ Repeated applications of the formatter did not change it further. The code formatter is owned by core should be fixed with bug 102780 (In reply to comment #3) > should be fixed with bug 102780 > It's fixed when block formatting is set ON; you get following output at the first formatting and never change after even with several repetitions: public class test { int x = 0; /* * XXXX */ } However, the problem still occurs when it's OFF... Created attachment 126872 [details]
Proposed patch
Created attachment 127007 [details]
New proposed patch
This patch is little bit less aggressive...
With previous patch, when the block comment was
/*
* comment
*/
a space was inserted before the beginning star of each line when the indentation was applied:
/*
* comment
*/
As it was not possible to know whether the comment initial indentation was intentional or not, I finally thought this was better to keep this behavior unchanged although the final result is less pretty than with previous patch... :-(
So, now the output is (as it was before the fix):
/*
* comment
*/
Released for 3.5M6 in HEAD stream. Verified for 3.5M6 with build I20090309-0100 |