Bug 282187 - [formatter] Exclude particular lines from auto-format
Summary: [formatter] Exclude particular lines from auto-format
Status: VERIFIED DUPLICATE of bug 27079
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 major with 1 vote (vote)
Target Milestone: 3.6 M6   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-01 13:18 EDT by bug r. naut CLA
Modified: 2010-03-09 06:12 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.