Bug 282187

Summary: [formatter] Exclude particular lines from auto-format
Product: [Eclipse Project] JDT Reporter: bug r. naut <buggernaut>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED DUPLICATE QA Contact:
Severity: major    
Priority: P3 CC: amj87.iitr, jarthana, Olivier_Thomann, waav_zoungla-eclipsebugzilla
Version: 3.5   
Target Milestone: 3.6 M6   
Hardware: All   
OS: All   
Whiteboard:

Description bug r. naut CLA 2009-07-01 13:18:07 EDT
often semantic structure is best mirrored in code structure, which doesn't necessarily fit the code conventions though. hence a feature that allows us to exclude particular lines from auto-formatting, to mark them as "don't format" basically, would be great and promote readability immensely in certain cases.
Comment 1 Amenel Voglozin CLA 2010-01-12 10:43:37 EST
Yes, this is a major functionality for me, especially in enumerations. Although the semantic structure argument is totally valid, I am more interested in simple readability of Java files.

Sample code:

public enum MsgId {
	//
	// keys for messages in the messages.properties file
	MSG_ASSOC_MANDATORY         ("association.is.mandatory"),
	MSG_DEFAULT_ERROR_MSG       ("default.error.msg"),
	MSG_FIELD_MANDATORY         ("field.is.mandatory"),
	MSG_FILE_FIELD_MANDATORY    ("file.field.label.mandatory"),
	MSG_FILL_MANDATORY_FIELDS   ("fill.mandatory.fields"),
	MSG_INTEGRITY_VIOLATION     ("integrity.violation"),
...
}

To this date, any formatting of  this class will make the enum look garbage.
A tag, directive, keyword, annotation, etc. anything that would prevent formatting of a portion of code would be fine for me.
Comment 2 Frederic Fusier CLA 2010-02-17 04:18:34 EST
Duplicate of bug 27079.

*** This bug has been marked as a duplicate of bug 27079 ***
Comment 3 Ayushman Jain CLA 2010-03-09 06:08:40 EST
Verified for 3.6M6 using build I20100305-1011.
Comment 4 Jay Arthanareeswaran CLA 2010-03-09 06:12:50 EST
Verified.