Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 31217

Summary: [smart editing] smart braces and comments
Product: [Eclipse Project] JDT Reporter: Andre Weinand <andre_weinand>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.1   
Target Milestone: 3.0 M6   
Hardware: Macintosh   
OS: All   
Whiteboard:
Bug Depends on: 38565    
Bug Blocks:    

Description Andre Weinand CLA 2003-02-07 05:13:08 EST
M5
- type this:
   int i= 1;
   if (i == 2)
      i= 3;
- insert '{' after closing parenthesis
Observe: a closing '}' is inserted after statement "i=3" 
- remove both braces
- add a line comment between if-statement and assigment
   int i= 1;
   if (i == 2)
      // a comment
      i= 3;
- insert '{' after closing parenthesis
Observe: a closing '}' is inserted before comment

It would be nice if existence of comment would not change behavior
Comment 1 Tom Hofmann CLA 2003-12-11 05:36:15 EST
we don't enclose simple control statements into the smart brace any longer. Use
quick fix for this. Closing.