Bug 89543

Summary: Unwanted new line and Tab after a function name 'set'
Product: [Applications] kdevelop Reporter: Steven T. Hatton <hattons>
Component: AstyleAssignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: normal CC: rutger, tassilo
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Steven T. Hatton 2004-09-15 07:40:08 UTC
Version:           3.1.0 (using KDE 3.3.0, SuSE)
Compiler:          gcc version 3.3.3 (SuSE Linux)
OS:                Linux (i686) release 2.6.5-7.108-default

In Coin3D (or, I assume any Open Inventor implementation) there are classes with a function called "set".  When I write 

set("material", "diffuseColor 1 1 0"); 

astyle reformats it to

set
      ("material", "diffuseColor 1 1 0");

In the same function, I have the expression

setPart("shape", new SoCone);

which remains formatted as shown.

I will add that "set" is displayed in black text whereas "setPart" is displayed in dark blue.  This indicates to me that aspell considers "set" to be a keyword.
Comment 1 Jens Dagerbo 2004-09-15 18:41:31 UTC
astyle doesn't do any highlighting, that's done by the editorpart (katepart?). Maybe I'm tired but I can't see why it would highlight "set" as a keyword. You are working with C++, right? 

Also, what formatting configuration are you using?
Comment 2 Nicolas Castagne 2005-03-14 11:34:00 UTC
This bug is also appearing with "set" keyword of the C++ STL, and as far as I know with all the "set" keywords (in Java, C#, etc.)

For example, when declaring a STL set of integer, as in : 
 
set <int> mySet ;
, the reformating tool gives : 
 
set
    <int> mySet;
Indeed, a new line and a tabulation is created... 
 
It seems to be related to astyle. Within astyle, "set" is a resevered keyword within astyle. Well, it should not...
Cf : http://www.kdevelop.org/phorum5/read.php?2,27113,27114#REPLY
Comment 3 Matt Rogers 2005-10-20 02:30:32 UTC
*** Bug 91906 has been marked as a duplicate of this bug. ***
Comment 4 Jens Dagerbo 2005-10-28 13:42:20 UTC
*** Bug 115189 has been marked as a duplicate of this bug. ***
Comment 5 Matt Rogers 2006-10-15 15:30:53 UTC
Fixed in the KDevelop 3.4 branch as part of this commit:

SVN commit 595657 by dymo:

Applied patch from Megan Webb:
Update to the astyle plugin to use astyle v1.19
Changes:
- layout of the formatting dialog has changed to mirror the astyle
command line options help.
- all options from commandline astyle can be set.
- interactive display of most options selected.
- tooltips for all options