Bug 140958 - code formatting doesn't attach brackets as set in preferences
Summary: code formatting doesn't attach brackets as set in preferences
Status: RESOLVED WORKSFORME
Alias: None
Product: kdevelop
Classification: Applications
Component: Astyle (show other bugs)
Version: 3.4.0
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-31 16:12 UTC by Andreas Pietzowski
Modified: 2007-06-15 20:25 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Some source where the problem occurs (131 bytes, text/plain)
2007-03-06 17:16 UTC, Rawk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Pietzowski 2007-01-31 16:12:16 UTC
Version:           3.4.0 (using KDE 3.5.6 "release 19.1" , openSUSE )
Compiler:          Target: i586-suse-linux
OS:                Linux (i686) release 2.6.16.27-0.6-smp

hello,

I configured code formatting either as JAVA (predefined) or UserDefined with Brackets->Attach. But both formattings always result in

function()
{
}

instead of

function(){
}

...wohooo way more lines of code just by re-formatting the source ;-)

Thanks for fixing this. 
Andreas
Comment 1 Andreas Pakulat 2007-01-31 17:13:34 UTC
I can't reproduce this here. After setting the options you need to use Reformat Sources. It doesn't work while typing, thats kate's part.
Comment 2 Rawk 2007-02-28 18:40:11 UTC
I have problems with brackets and code formatting, too (KDevelop 3.4.0 on Gentoo).
This is how I want it to be:
void foo()
{
}

This is the result for most functions (some functions are formatted as expected):
void foo()

{
}

These are the astyle settings from my kdeveloprc:
[AStyle]
Extensions=*.cpp *.h,*.c *.h,*.cxx *.hxx,*.c++ *.h++,*.cc *.hh,*.C *.H,*.diff,*.inl,*.java,*.moc,*.patch,*.tlh,*.xpm
Fill=Tabs
IndentLabels=false
IndentNamespaces=false
IndentSwitches=true
Options=BlockBreak=0,BlockBreakAll=0,BlockIfElse=0,Brackets=Break,BracketsCloseHeaders=0,FStyle=UserDefined,Fill=Tabs,FillCount=4,FillEmptyLines=0,FillForce=1,IndentBlocks=0,IndentBrackets=0,IndentCases=0,IndentClasses=0,IndentLabels=0,IndentNamespaces=0,IndentPreprocessors=0,IndentSwitches=0,KeepBlocks=0,KeepStatements=0,MaxStatement=40,MinConditional=-1,PadOperators=1,PadParenthesesIn=0,PadParenthesesOut=0,PadParenthesesUn=0,
Comment 3 Andreas Pakulat 2007-02-28 20:10:28 UTC
I still can't reproduce this problem with those settings. Could either of you please poste a source file where the problem occurs?
Comment 4 Rawk 2007-03-06 17:16:44 UTC
Created attachment 19896 [details]
Some source where the problem occurs

Ok, here some code where the problem occurs. Code formatting results in:
Font::Font(const QString& fontString)
{
	setFont(fontString);
}

Font::Font(const QDomElement& xfontElem)

{
	setFont(xfontElem);
}
Comment 5 Andreas Pakulat 2007-03-06 19:14:15 UTC
Sorry, I still can't reproduce the problem.
Comment 6 Adam Celarek 2007-06-09 18:55:37 UTC
Same bug here (newest svn version). Additionally astyle ignores other settings (for instance it adds spaces around parenthesis although the option isn't ticked). Similar to bug 137913 and 105396.

It worked with version 3.3.93, but if I start now the old version, it doesn't work anymore. So it has something to do with configuration files..
Comment 7 Adam Celarek 2007-06-09 19:11:27 UTC
Hm, or with another astyle bug (see bug 138699)
Comment 8 Andreas Pakulat 2007-06-09 19:33:27 UTC
Note that the astyle settings are available under Configure KDevelop and Project Options. The Project Options have precedence.
Comment 9 Adam Celarek 2007-06-15 19:55:07 UTC
Yeah, I've noticed that right now. It works here. But a note etc in the global options would be appropriate..
Comment 10 Andreas Pakulat 2007-06-15 20:25:46 UTC
Thats unfortunately not possible anymore for KDevelop3, no user-visible-string changes are allowed.

The bug is not reproduceable with 3.4.1 and we had an astyle update since 3.4.0, so I'm closing it.