Bug 27511

Summary: [typing] Java auto-indent strategy could insert SPACE in several places
Product: [Eclipse Project] JDT Reporter: Randy Hudson <hudsonr>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3    
Version: 2.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Randy Hudson CLA 2002-12-02 13:06:33 EST
The Java source editor should insert whitespace more often, to correlate with 
my "format" settings.  For example:

"if(condition)"
should become
"if (condition)"

"void foo(){"
should become
"void foo() {"

"}else{"
should become
"} else {"

"new Rectangle(0,0,l+r,t+b)"
should become
"new Rectangle(0, 0, l + r, t + b)"

I believe these are simple cases. It would be too aggressive to apply every 
format option as you type (especially newlines), but a single space is often 
useful.
Comment 1 Randy Hudson CLA 2003-02-14 10:11:45 EST
Please consider for 2.1.  The hardest part about this change would be naming 
the preference.  Maybe there is already an existing preference that this fall 
under.
Comment 2 Randy Hudson CLA 2004-09-07 11:40:22 EDT
I have a patch which implements this functionality but without looking at 
formatting preferences.  It assumes the standard preferences are enabled.  It 
handles operators like "++" and "+=".  The only case I have handled yet is "-" 
used to negate.  So you get "y = x * - z".

Changing status from ASSIGNED since JDT-INBOX is not a person
Comment 3 Dani Megert CLA 2004-09-07 11:53:01 EDT
ASSIGNED means we looked at the bug and it now waits to be assigned to some
developer. NEW means we did not yet look at the bug or did not yet accept it.

Most of our typing functionality consults the formatter preferences. The same
should be true for your patch.

To me this looks like a *Format while typing" feature.