This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 216290 - Enhance code formatting
Summary: Enhance code formatting
Status: CLOSED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.2
Hardware: PC Windows 7 x64
: P2 normal (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-02 04:18 UTC by kosmonaffft
Modified: 2015-12-14 06:56 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kosmonaffft 2012-08-02 04:18:01 UTC
Hello all...

1) Formatting of pointers and references - now NetBeans format pointers and references by different ways. As example if i define method with references in arguments, NetBeans format it like this:

void someMethod(const string& s1, const string & s2) // Additional space before &

i think it will be greate if user can set how this code should be formatted (possible variants are string& s1, string & s1, string &s1). Also this point can be applied to pointers and rvalue references.

2) Formatting of template functions - now NetBeans format using of function std::get from c++11 standard like this:
std::get< 0 >(some_tuple), but i expect wormatting without spaces around zero.
Comment 1 mug896 2012-09-04 19:11:40 UTC
rvalue reference have always space both sides.
so it's looks like Logical AND operator.
Comment 2 kosmonaffft 2012-09-05 02:45:50 UTC
I think this bug is in the C++ parser... If somebody can tell me where in NB source tree parser (and code model) is placed and how is it implemented (generated via Antlr, handwritten or generated via other tools), i can try fix it...
Comment 3 Vladimir Voskresensky 2012-09-07 07:40:32 UTC
you are welcome to try and fix cnd.editor/src/org/netbeans/modules/cnd/editor/reformat/ReformatterImpl.java
make sure that all tests for cnd.editor passes after that and add more for fixed constructions
Comment 4 Alexander Simon 2012-10-10 14:44:03 UTC
fixed problem 2, change set:
http://hg.netbeans.org/cnd-main/rev/4f4577f2b675
Comment 5 Quality Engineering 2012-10-11 02:01:26 UTC
Integrated into 'main-golden', will be available in build *201210110002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/4f4577f2b675
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed mentioned problems in the RFE #216290 - Enhance code formatting
Comment 6 kosmonaffft 2015-11-04 06:57:44 UTC
Looks like NB does not reformat spaces around & in parameters declaration.