Bug 263834

Summary: KDevelop must support pointer/reference align mode for indentation (reformatting)
Product: [Applications] kdevelop Reporter: Denis Pesotsky <denis>
Component: generalAssignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: normal CC: denis, fedotov.i.f, lamefun.x0r
Priority: HI    
Version: unspecified   
Target Milestone: 4.2.0   
Platform: unspecified   
OS: Unspecified   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Denis Pesotsky 2011-01-21 10:36:46 UTC
Version:           unspecified
OS:                unspecified

There are 3 ways to indent «*» in pointers and «&» in references:
int* a — Stroustrup style
int *a — K&R style
int * a — neutral guys style

astyle has «--align-pointer» option to handle this, it can be equal to type/middle/name.

KDevelop currently don't support this option in indentation/reformatting, but alligns to type on auto-completion (!) and that suxx. In most Qt and KDE sources, it's alligned to name. Personally I prefer alligning to name too.

Reproducible: Always

Steps to Reproduce:
Reformat following code:

Class& func(const QPoint &a)
{
    int *a;
    int * b;
    int* c;
    return *this;
}

Actual Results:  
Class& func(const QPoint &a)
{
    int *a;
    int * b;
    int* c;
    return *this;
}

Expected Results:  
It don't change pointers and references

Class &func(const QPoint &a)
{
    int *a;
    int *b;
    int *c;
    return *this;
}
Comment 1 Denis Pesotsky 2011-01-21 10:51:57 UTC
Dam I mistaken. Fixed:

Actual Results:  
It don't change pointers and references

Class& func(const QPoint &a)
{
    int *a;
    int * b;
    int* c;
    return *this;
}

Expected Results:  
Class &func(const QPoint &a)
{
    int *a;
    int *b;
    int *c;
    return *this;
}
Comment 2 Andrey 2011-01-21 11:25:28 UTC
*** This bug has been confirmed by popular vote. ***
Comment 3 Milian Wolff 2011-01-24 13:57:59 UTC
yep, we need to update our astyle lib checkout and add the new features in there
Comment 4 Milian Wolff 2011-04-01 10:51:52 UTC
fixed since some time
Comment 5 Andrey Batyiev 2011-04-02 15:20:34 UTC
*** Bug 255039 has been marked as a duplicate of this bug. ***