Bug 49899 - [formatting] Code formatter shouldnt format pre tags in javadoc
Summary: [formatting] Code formatter shouldnt format pre tags in javadoc
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2004-01-13 06:03 EST by Robert (Kraythe) Simmons CLA
Modified: 2007-06-22 10:04 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert (Kraythe) Simmons CLA 2004-01-13 06:03:03 EST
If I use a pre tag in my javadoc, the code formatter should leave the contents 
of the pre tag untouched. For example, the following shouldnt be changed. 

	/**
	 * Setter for endDateTime; The date and time that this event ends 
(§2.3.11).
	 *
	 * @param endDateTime The new value for endDateTime.
	 * @preconditions
	 * <pre>
	 * endDateTime != null
	 * and if startDateTime != null 
	 *     then endDateTime > startDateTime
	 *          and endDateTime - startDateTime == duration
	 * </pre>
	 */

However, the code formatter currently reformats my pre to look like the 
following: 

	/**
	 * Setter for endDateTime; The date and time that this event ends
	 * (§2.3.11).
	 * 
	 * @param endDateTime The new value for endDateTime. @preconditions
	 * 
	 * <pre>
	 *  endDateTime != null and if startDateTime != null then endDateTime 
> startDateTime and endDateTime - startDateTime == duration
	 * </pre>
	 */

This is clearly not the right thing to do.
Comment 1 Olivier Thomann CLA 2004-01-13 10:05:20 EST
Move to JDT/Text for comment.
Comment 2 Dani Megert CLA 2004-01-13 12:28:58 EST
This is an option: per default we assume code fragments inside pre tags and
format them as it would be Javadoc.

You can disable this in the Code Formatter preferences:
[] Format Java code snippets
Comment 3 Dani Megert CLA 2007-06-22 09:59:05 EDT
Get rid of deprecated state.
Comment 4 Dani Megert CLA 2007-06-22 10:04:25 EDT
.