|
|
|
@ -32,7 +32,7 @@ namespace ICSharpCode.NRefactory.CSharp
@@ -32,7 +32,7 @@ namespace ICSharpCode.NRefactory.CSharp
|
|
|
|
|
{ |
|
|
|
|
public override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration) |
|
|
|
|
{ |
|
|
|
|
FixAttributes(propertyDeclaration); |
|
|
|
|
FixAttributesAndDocComment(propertyDeclaration); |
|
|
|
|
bool oneLine = false; |
|
|
|
|
bool fixClosingBrace = false; |
|
|
|
|
switch (policy.PropertyFormatting) { |
|
|
|
@ -158,7 +158,7 @@ namespace ICSharpCode.NRefactory.CSharp
@@ -158,7 +158,7 @@ namespace ICSharpCode.NRefactory.CSharp
|
|
|
|
|
|
|
|
|
|
public override void VisitAccessor(Accessor accessor) |
|
|
|
|
{ |
|
|
|
|
FixAttributes(accessor); |
|
|
|
|
FixAttributesAndDocComment(accessor); |
|
|
|
|
|
|
|
|
|
base.VisitAccessor(accessor); |
|
|
|
|
} |
|
|
|
@ -166,7 +166,7 @@ namespace ICSharpCode.NRefactory.CSharp
@@ -166,7 +166,7 @@ namespace ICSharpCode.NRefactory.CSharp
|
|
|
|
|
|
|
|
|
|
public override void VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration) |
|
|
|
|
{ |
|
|
|
|
FixAttributes(indexerDeclaration); |
|
|
|
|
FixAttributesAndDocComment(indexerDeclaration); |
|
|
|
|
|
|
|
|
|
ForceSpacesBefore(indexerDeclaration.LBracketToken, policy.SpaceBeforeIndexerDeclarationBracket); |
|
|
|
|
ForceSpacesAfter(indexerDeclaration.LBracketToken, policy.SpaceWithinIndexerDeclarationBracket); |
|
|
|
@ -217,7 +217,7 @@ namespace ICSharpCode.NRefactory.CSharp
@@ -217,7 +217,7 @@ namespace ICSharpCode.NRefactory.CSharp
|
|
|
|
|
|
|
|
|
|
public override void VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration) |
|
|
|
|
{ |
|
|
|
|
FixAttributes(eventDeclaration); |
|
|
|
|
FixAttributesAndDocComment(eventDeclaration); |
|
|
|
|
|
|
|
|
|
FixOpenBrace(policy.EventBraceStyle, eventDeclaration.LBraceToken); |
|
|
|
|
if (policy.IndentEventBody) |
|
|
|
@ -259,7 +259,7 @@ namespace ICSharpCode.NRefactory.CSharp
@@ -259,7 +259,7 @@ namespace ICSharpCode.NRefactory.CSharp
|
|
|
|
|
|
|
|
|
|
public override void VisitEventDeclaration(EventDeclaration eventDeclaration) |
|
|
|
|
{ |
|
|
|
|
FixAttributes(eventDeclaration); |
|
|
|
|
FixAttributesAndDocComment(eventDeclaration); |
|
|
|
|
|
|
|
|
|
foreach (var m in eventDeclaration.ModifierTokens) { |
|
|
|
|
ForceSpacesAfter(m, true); |
|
|
|
@ -286,14 +286,14 @@ namespace ICSharpCode.NRefactory.CSharp
@@ -286,14 +286,14 @@ namespace ICSharpCode.NRefactory.CSharp
|
|
|
|
|
|
|
|
|
|
public override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration) |
|
|
|
|
{ |
|
|
|
|
FixAttributes(fieldDeclaration); |
|
|
|
|
FixAttributesAndDocComment(fieldDeclaration); |
|
|
|
|
|
|
|
|
|
fieldDeclaration.ReturnType.AcceptVisitor(this); |
|
|
|
|
ForceSpacesAfter(fieldDeclaration.ReturnType, true); |
|
|
|
|
|
|
|
|
|
FormatCommas(fieldDeclaration, policy.SpaceBeforeFieldDeclarationComma, policy.SpaceAfterFieldDeclarationComma); |
|
|
|
|
|
|
|
|
|
var lastLoc = fieldDeclaration.StartLocation; |
|
|
|
|
var lastLoc = fieldDeclaration.ReturnType.StartLocation; |
|
|
|
|
foreach (var initializer in fieldDeclaration.Variables) { |
|
|
|
|
if (lastLoc.Line != initializer.StartLocation.Line) { |
|
|
|
|
curIndent.Push(IndentType.Block); |
|
|
|
@ -308,7 +308,7 @@ namespace ICSharpCode.NRefactory.CSharp
@@ -308,7 +308,7 @@ namespace ICSharpCode.NRefactory.CSharp
|
|
|
|
|
|
|
|
|
|
public override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration) |
|
|
|
|
{ |
|
|
|
|
FixAttributes(fixedFieldDeclaration); |
|
|
|
|
FixAttributesAndDocComment(fixedFieldDeclaration); |
|
|
|
|
|
|
|
|
|
FormatCommas(fixedFieldDeclaration, policy.SpaceBeforeFieldDeclarationComma, policy.SpaceAfterFieldDeclarationComma); |
|
|
|
|
|
|
|
|
@ -327,7 +327,7 @@ namespace ICSharpCode.NRefactory.CSharp
@@ -327,7 +327,7 @@ namespace ICSharpCode.NRefactory.CSharp
|
|
|
|
|
|
|
|
|
|
public override void VisitEnumMemberDeclaration(EnumMemberDeclaration enumMemberDeclaration) |
|
|
|
|
{ |
|
|
|
|
FixAttributes(enumMemberDeclaration); |
|
|
|
|
FixAttributesAndDocComment(enumMemberDeclaration); |
|
|
|
|
var initializer = enumMemberDeclaration.Initializer; |
|
|
|
|
if (!initializer.IsNull) { |
|
|
|
|
ForceSpacesAround(enumMemberDeclaration.AssignToken, policy.SpaceAroundAssignment); |
|
|
|
@ -337,7 +337,7 @@ namespace ICSharpCode.NRefactory.CSharp
@@ -337,7 +337,7 @@ namespace ICSharpCode.NRefactory.CSharp
|
|
|
|
|
|
|
|
|
|
public override void VisitMethodDeclaration(MethodDeclaration methodDeclaration) |
|
|
|
|
{ |
|
|
|
|
FixAttributes(methodDeclaration); |
|
|
|
|
FixAttributesAndDocComment(methodDeclaration); |
|
|
|
|
|
|
|
|
|
ForceSpacesBefore(methodDeclaration.LParToken, policy.SpaceBeforeMethodDeclarationParentheses); |
|
|
|
|
if (methodDeclaration.Parameters.Any()) { |
|
|
|
@ -357,7 +357,7 @@ namespace ICSharpCode.NRefactory.CSharp
@@ -357,7 +357,7 @@ namespace ICSharpCode.NRefactory.CSharp
|
|
|
|
|
|
|
|
|
|
public override void VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration) |
|
|
|
|
{ |
|
|
|
|
FixAttributes(operatorDeclaration); |
|
|
|
|
FixAttributesAndDocComment(operatorDeclaration); |
|
|
|
|
|
|
|
|
|
ForceSpacesBefore(operatorDeclaration.LParToken, policy.SpaceBeforeMethodDeclarationParentheses); |
|
|
|
|
if (operatorDeclaration.Parameters.Any()) { |
|
|
|
@ -377,7 +377,7 @@ namespace ICSharpCode.NRefactory.CSharp
@@ -377,7 +377,7 @@ namespace ICSharpCode.NRefactory.CSharp
|
|
|
|
|
|
|
|
|
|
public override void VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration) |
|
|
|
|
{ |
|
|
|
|
FixAttributes(constructorDeclaration); |
|
|
|
|
FixAttributesAndDocComment(constructorDeclaration); |
|
|
|
|
|
|
|
|
|
ForceSpacesBefore(constructorDeclaration.LParToken, policy.SpaceBeforeConstructorDeclarationParentheses); |
|
|
|
|
if (constructorDeclaration.Parameters.Any()) { |
|
|
|
@ -397,7 +397,7 @@ namespace ICSharpCode.NRefactory.CSharp
@@ -397,7 +397,7 @@ namespace ICSharpCode.NRefactory.CSharp
|
|
|
|
|
|
|
|
|
|
public override void VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration) |
|
|
|
|
{ |
|
|
|
|
FixAttributes(destructorDeclaration); |
|
|
|
|
FixAttributesAndDocComment(destructorDeclaration); |
|
|
|
|
|
|
|
|
|
CSharpTokenNode lParen = destructorDeclaration.LParToken; |
|
|
|
|
ForceSpaceBefore(lParen, policy.SpaceBeforeConstructorDeclarationParentheses); |
|
|
|
|