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

Bug 324031

Summary: Indentation problems with typedef and enum
Product: [Tools] CDT Reporter: Henning Riedel <kesselhaus>
Component: cdt-editorAssignee: Anton Leherbauer <aleherb+eclipse>
Status: RESOLVED FIXED QA Contact: Anton Leherbauer <aleherb+eclipse>
Severity: normal    
Priority: P3 CC: eclipse.sprigogin
Version: 7.0.1   
Target Milestone: 7.0.1   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Attachments:
Description Flags
Code Style Formatter Settings based on BSD-Allman
none
Fix and tests aleherb+eclipse: iplog-

Description Henning Riedel CLA 2010-08-30 16:43:05 EDT
Created attachment 177784 [details]
Code Style Formatter Settings based on BSD-Allman

Hi folks,

I have here a little annoying thing about indentation. I have CodeStyle set to BSD-Allman

typedef struct
        {
    blah
        };

typedef struct {
    blah
};


That also happens for things like

typedef enum {
    XYZ_ENUM_VALUE1,
   
};

typedef enum         <-- Write typedef enum and hit <ENTER>
        {            <-- Indented automatically, then just wrote '{' and hit <ENTER>
    ENUM_VALUE1      <-- Indented
   
        };

enum {
    XYZ_ENUM_VALUE10 = 0x00,
            XYZ_ENUM_VALUE11      <-- Indented if there is the = 0x00, in the line before
};

Could someone enlighten me, if this is a problem with the attached settings, or are these actually bugs in the indenter?

Regards,
Henning
Comment 1 Anton Leherbauer CLA 2010-08-31 04:50:12 EDT
Created attachment 177817 [details]
Fix and tests

This patch fixes the typedef issue (a regression) and the enum problem which exists also in 6.0.2.
Comment 2 Anton Leherbauer CLA 2010-08-31 04:53:25 EDT
Sergey, could you review my changes before I commit?
Comment 3 Sergey Prigogin CLA 2010-09-01 00:40:08 EDT
LGTM
Comment 4 Anton Leherbauer CLA 2010-09-01 02:07:36 EDT
Thank you! Committed to HEAD and cdt_7_0.