Bug 305518

Summary: [formatter] Line inside <pre> tag is wrongly indented by one space when starting just after the star
Product: [Eclipse Project] JDT Reporter: Frederic Fusier <frederic_fusier>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jarthana, satyam.kandula
Version: 3.6   
Target Milestone: 3.6 M7   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=287833
https://bugs.eclipse.org/bugs/show_bug.cgi?id=303957
Whiteboard:
Attachments:
Description Flags
Proposed patch none

Description Frederic Fusier CLA 2010-03-11 10:44:53 EST
Using 3.6M6 candidate (ie. I20100310-1800).

Looking closer at fix for bug 303957, I saw that there's something wrong with the current formatting of the code snippet:

public interface Test {
/**
 * <pre>
 *    A
 *   / \
 *  B   C
 * / \ / \
 *D  E F  G
 * </pre>
 */
public void foo();
}

is formatted as:
public interface Test {
	/**
	 * <pre>
	 *    A
	 *   / \
	 *  B   C
	 * / \ / \
	 * D  E F  G
	 * </pre>
	 */
	public void foo();
}

Observe that the 5th ligne inside the <pre> tag is indented by one space regarding the original lines...

Instead, it should be:

public interface Test {
	/**
	 * <pre>
	 *    A
	 *   / \
	 *  B   C
	 * / \ / \
	 *D  E F  G
	 * </pre>
	 */
	public void foo();
}
Comment 1 Frederic Fusier CLA 2010-03-23 10:54:27 EDT
Created attachment 162772 [details]
Proposed patch

Improve the way to remove/insert prefix stars in the javadoc comment snippet. When a non-spaces characters is discovered just after the prefix star, then shift the entire snippet one space to the right.
Comment 2 Frederic Fusier CLA 2010-03-23 10:55:18 EDT
(In reply to comment #1)
> Created an attachment (id=162772) [details]
> Proposed patch
> 
Released for 3.6M7 in HEAD stream.
Comment 3 Satyam Kandula CLA 2010-04-26 04:28:20 EDT
Verified for 3.6M7 using build I20100424-2000