Bug 13413 - Formatter inserts new line between #undef statements in an #if block on every reformat
Summary: Formatter inserts new line between #undef statements in an #if block on every...
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 4.1
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: master
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2013-07-23 10:34 UTC by kissling
Modified: 2013-07-24 04:33 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description kissling 2013-07-23 10:34:18 UTC
When reformatting a document, new empty lines are added between #undef statements within an #if block. Every reformat adds another line.

Sample document:
#if foo
#undef a
#undef b
#undef c
#undef d
#endif

Formatter settings (.sln file):

		Policies = $0
		$0.DotNetNamingPolicy = $1
		$1.DirectoryNamespaceAssociation = None
		$1.ResourceNamePolicy = FileFormatDefault
		$0.TextStylePolicy = $2
		$2.FileWidth = 120
		$2.TabsToSpaces = False
		$2.inheritsSet = VisualStudio
		$2.inheritsScope = text/plain
		$0.TextStylePolicy = $3
		$3.inheritsSet = null
		$3.scope = text/x-csharp
		$0.CSharpFormattingPolicy = $4
		$4.IndentSwitchBody = True
		$4.AnonymousMethodBraceStyle = NextLine
		$4.PropertyBraceStyle = NextLine
		$4.PropertyGetBraceStyle = NextLine
		$4.PropertySetBraceStyle = NextLine
		$4.EventBraceStyle = NextLine
		$4.EventAddBraceStyle = NextLine
		$4.EventRemoveBraceStyle = NextLine
		$4.StatementBraceStyle = NextLine
		$4.ElseNewLinePlacement = NewLine
		$4.ElseIfNewLinePlacement = SameLine
		$4.CatchNewLinePlacement = NewLine
		$4.FinallyNewLinePlacement = NewLine
		$4.WhileNewLinePlacement = NewLine
		$4.ArrayInitializerWrapping = WrapAlways
		$4.ArrayInitializerBraceStyle = NextLine
		$4.BeforeMethodDeclarationParentheses = False
		$4.BeforeMethodCallParentheses = False
		$4.BeforeConstructorDeclarationParentheses = False
		$4.BeforeIndexerDeclarationBracket = False
		$4.BeforeDelegateDeclarationParentheses = False
		$4.NewParentheses = False
		$4.SpacesBeforeBrackets = False
		$4.BlankLinesBetweenFields = 1
		$4.BlankLinesBetweenEventFields = 1
		$4.MethodCallArgumentWrapping = WrapIfTooLong
		$4.MethodDeclarationParameterWrapping = WrapIfTooLong
		$4.IndexerDeclarationParameterWrapping = WrapIfTooLong
		$4.IndexerArgumentWrapping = WrapIfTooLong
		$4.inheritsSet = Mono
		$4.inheritsScope = text/x-csharp
		$4.scope = text/x-csharp
		$0.TextStylePolicy = $5
		$5.FileWidth = 120
		$5.EolMarker = Windows
		$5.inheritsSet = VisualStudio
		$5.inheritsScope = text/plain
		$5.scope = text/plain
		$0.TextStylePolicy = $6
		$6.inheritsSet = null
		$6.scope = application/xml
		$0.XmlFormattingPolicy = $7
		$7.inheritsSet = Mono
		$7.inheritsScope = application/xml
		$7.scope = application/xml
		$0.TextStylePolicy = $8
		$8.inheritsSet = null
		$8.scope = application/vnd.apple-xcode-storyboard
		$0.XmlFormattingPolicy = $9
		$9.inheritsSet = null
		$9.scope = application/vnd.apple-xcode-storyboard
		$0.TextStylePolicy = $10
		$10.inheritsSet = null
		$10.scope = text/x-apple-strings
		$0.StandardHeader = $11
		$11.Text = 
		$11.IncludeInNewFiles = True
		$0.NameConventionPolicy = $12
		$12.Rules = $13
		$13.NamingRule = $14
		$14.Name = Namespaces
		$14.AffectedEntity = Namespace
		$14.VisibilityMask = VisibilityMask
		$14.NamingStyle = PascalCase
		$14.IncludeInstanceMembers = True
		$14.IncludeStaticEntities = True
		$13.NamingRule = $15
		$15.Name = Types
		$15.AffectedEntity = Class, Struct, Enum, Delegate
		$15.VisibilityMask = Public
		$15.NamingStyle = PascalCase
		$15.IncludeInstanceMembers = True
		$15.IncludeStaticEntities = True
		$13.NamingRule = $16
		$16.Name = Interfaces
		$16.RequiredPrefixes = $17
		$17.String = I
		$16.AffectedEntity = Interface
		$16.VisibilityMask = Public
		$16.NamingStyle = PascalCase
		$16.IncludeInstanceMembers = True
		$16.IncludeStaticEntities = True
		$13.NamingRule = $18
		$18.Name = Attributes
		$18.RequiredSuffixes = $19
		$19.String = Attribute
		$18.AffectedEntity = CustomAttributes
		$18.VisibilityMask = Public
		$18.NamingStyle = PascalCase
		$18.IncludeInstanceMembers = True
		$18.IncludeStaticEntities = True
		$13.NamingRule = $20
		$20.Name = Event Arguments
		$20.RequiredSuffixes = $21
		$21.String = EventArgs
		$20.AffectedEntity = CustomEventArgs
		$20.VisibilityMask = Public
		$20.NamingStyle = PascalCase
		$20.IncludeInstanceMembers = True
		$20.IncludeStaticEntities = True
		$13.NamingRule = $22
		$22.Name = Exceptions
		$22.RequiredSuffixes = $23
		$23.String = Exception
		$22.AffectedEntity = CustomExceptions
		$22.VisibilityMask = VisibilityMask
		$22.NamingStyle = PascalCase
		$22.IncludeInstanceMembers = True
		$22.IncludeStaticEntities = True
		$13.NamingRule = $24
		$24.Name = Methods
		$24.AffectedEntity = Methods
		$24.VisibilityMask = Protected, Public
		$24.NamingStyle = PascalCase
		$24.IncludeInstanceMembers = True
		$24.IncludeStaticEntities = True
		$13.NamingRule = $25
		$25.Name = Static Readonly Fields
		$25.RequiredPrefixes = $26
		$26.String = _
		$25.AffectedEntity = ReadonlyField
		$25.VisibilityMask = Protected, Public
		$25.NamingStyle = CamelCase
		$25.IncludeInstanceMembers = False
		$25.IncludeStaticEntities = True
		$13.NamingRule = $27
		$27.Name = Fields
		$27.RequiredPrefixes = $28
		$28.String = _
		$27.AffectedEntity = Field
		$27.VisibilityMask = Protected, Public
		$27.NamingStyle = CamelCase
		$27.IncludeInstanceMembers = True
		$27.IncludeStaticEntities = True
		$13.NamingRule = $29
		$29.Name = ReadOnly Fields
		$29.RequiredPrefixes = $30
		$30.String = _
		$29.AffectedEntity = ReadonlyField
		$29.VisibilityMask = Protected, Public
		$29.NamingStyle = CamelCase
		$29.IncludeInstanceMembers = True
		$29.IncludeStaticEntities = False
		$13.NamingRule = $31
		$31.Name = Constant Fields
		$31.RequiredPrefixes = $32
		$32.String = _
		$31.AffectedEntity = ConstantField
		$31.VisibilityMask = Protected, Public
		$31.NamingStyle = CamelCase
		$31.IncludeInstanceMembers = True
		$31.IncludeStaticEntities = True
		$13.NamingRule = $33
		$33.Name = Properties
		$33.AffectedEntity = Property
		$33.VisibilityMask = Protected, Public
		$33.NamingStyle = PascalCase
		$33.IncludeInstanceMembers = True
		$33.IncludeStaticEntities = True
		$13.NamingRule = $34
		$34.Name = Events
		$34.AffectedEntity = Event
		$34.VisibilityMask = Protected, Public
		$34.NamingStyle = PascalCase
		$34.IncludeInstanceMembers = True
		$34.IncludeStaticEntities = True
		$13.NamingRule = $35
		$35.Name = Enum Members
		$35.AffectedEntity = EnumMember
		$35.VisibilityMask = VisibilityMask
		$35.NamingStyle = PascalCase
		$35.IncludeInstanceMembers = True
		$35.IncludeStaticEntities = True
		$13.NamingRule = $36
		$36.Name = Parameters
		$36.AffectedEntity = Parameter
		$36.VisibilityMask = VisibilityMask
		$36.NamingStyle = CamelCase
		$36.IncludeInstanceMembers = True
		$36.IncludeStaticEntities = True
		$13.NamingRule = $37
		$37.Name = Type Parameters
		$37.RequiredPrefixes = $38
		$38.String = T
		$37.AffectedEntity = TypeParameter
		$37.VisibilityMask = VisibilityMask
		$37.NamingStyle = PascalCase
		$37.IncludeInstanceMembers = True
		$37.IncludeStaticEntities = True


Version information:

=== Xamarin Studio ===

Version 4.1.7 (build 87)
Installation UUID: 938751df-f7a5-457d-b87b-379763e0ada1
Runtime:
	Mono 3.1.2 ((no/71af847)
	GTK 2.24.20
	GTK# (2.12.0.0)
	Package version: 301020000

=== Apple Developer Tools ===

Xcode 5.0 (3325.22)
Build 5A11344j

=== Xamarin.iOS ===

Version: 6.9.4.40 (Business Edition)
Hash: 7f9e851
Branch: 
Build date: 2013-10-07 12:10:26-0400

=== Xamarin.Mac ===

Xamarin.Mac: Not Installed

=== Xamarin.Android ===

Version: 4.8.0 (Business Edition)
Android SDK: /Users/***/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
Java SDK: /usr
java version "1.6.0_51"
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457-11M4509)
Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-457, mixed mode)

=== Build Information ===

Release ID: 401070087
Git revision: e8d353852416693588e6e53a5c2b2d70e5ddadfb
Build date: 2013-07-18 15:32:11+0000
Xamarin addins: 7a764a450cd980c7942b91f12ac36947f9c6a71f

=== Operating System ===

Mac OS X 10.8.4
Darwin ***.local 12.4.0 Darwin Kernel Version 12.4.0
    Wed May  1 17:57:12 PDT 2013
    root:xnu-2050.24.15~1/RELEASE_X86_64 x86_64
Comment 1 Mike Krüger 2013-07-24 04:33:37 UTC
fixed