Bug 180958

Summary: Add Support for indented braces
Product: [Eclipse Project] JDT Reporter: Bobby Skinner <bobby>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED INVALID QA Contact:
Severity: enhancement    
Priority: P3    
Version: 3.2.2   
Target Milestone: 3.3 M7   
Hardware: All   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Screen shot of settings none

Description Bobby Skinner CLA 2007-04-04 10:34:34 EDT
I would like to add support for my coding style in the editor. I would like to have the curly braces indented like this:

	private JTextField getCounter()
	        {
		if (counter == null)
		        {
			counter = new JTextField();
			counter.setSize(new Dimension(336, 22));
		        }
		return counter;
	        }

currently the closest I can achieve is like this:

	private JTextField getCounter()
	{
		if (counter == null)
		{
			counter = new JTextField();
			counter.setSize(new Dimension(336, 22));
		}
		return counter;
	}

I realize that my style is not the most popular, but I have been using it for 20 years and prefer it. It seems with all the flexibility the the IDE supports that this one item would not be a big deal.
Comment 1 Dani Megert CLA 2007-04-23 16:23:10 EDT
Do you mean by the formatter or while typing?
Can you configure the formatter to match your style?
Comment 2 Bobby Skinner CLA 2007-04-23 16:51:24 EDT
Created attachment 64655 [details]
Screen shot of settings
Comment 3 Bobby Skinner CLA 2007-04-23 16:52:03 EDT
I did not see a way to configure it to operate this way. I was meaning the format as you type options. The closest I could get formated with the braces not indented, this means that I have to go back and manually change them after I enter them.

If it is possible to achieve this kind of automatic formatting is achievable, please describe which settings to set to do this. I will attach a screen shot showing the issue.

I am sorry if I am just unfamiliar with it and missed the option. I have just started to use eclipse as our new IDE is built around it. But I still use slickedit most of the time but eclipse is good enough that I may switch to it once I figure it out completely.
Comment 4 Dani Megert CLA 2007-04-24 02:38:12 EDT
We use the formatter prefs for auto-indenting i.e. we first need this being supported by the formatter. Moving to JDT Core.
Comment 5 Olivier Thomann CLA 2007-04-24 11:00:48 EDT
The brace setting "Next line indented" is exactly what you are looking for.
Comment 6 Olivier Thomann CLA 2007-04-24 11:01:12 EDT
Closing as INVALID.
Comment 7 Olivier Thomann CLA 2007-05-03 20:55:28 EDT
Verify for 3.3M7 with I20070503-1400.