public override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)
        {
            FixAttributesAndDocComment(fieldDeclaration);

            fieldDeclaration.ReturnType.AcceptVisitor(this);
            ForceSpacesAfter(fieldDeclaration.ReturnType, true);

            FormatCommas(fieldDeclaration, policy.SpaceBeforeFieldDeclarationComma, policy.SpaceAfterFieldDeclarationComma);

            var lastLoc = fieldDeclaration.ReturnType.StartLocation;

            foreach (var initializer in fieldDeclaration.Variables)
            {
                if (lastLoc.Line != initializer.StartLocation.Line)
                {
                    curIndent.Push(IndentType.Block);
                    FixStatementIndentation(initializer.StartLocation);
                    curIndent.Pop();
                    lastLoc = initializer.StartLocation;
                }
                initializer.AcceptVisitor(this);
            }
            FixSemicolon(fieldDeclaration.SemicolonToken);
        }
Example #2
0
        public bool CheckField(ICS.FieldDeclaration node, InspectionData data)
        {
            if ((MatchKind != 0 && (MatchKind & DeclarationKinds.Field) == 0))
            {
                return(false);
            }

            if (!CheckAttributedNode(node, ICS.Modifiers.Private))
            {
                return(false);
            }

            foreach (var v in node.Variables)
            {
                string name = v.Name;
                if (IsValid(name))
                {
                    continue;
                }
                data.Add(GetFixableResult(v.NameToken.StartLocation, null, name));
            }

            return(true);
        }
Example #3
0
 void IAstVisitor.VisitFieldDeclaration(FieldDeclaration fieldDeclaration)
 {
     Visit(EnterFieldDeclaration, LeaveFieldDeclaration, fieldDeclaration);
 }
 public virtual S VisitFieldDeclaration(FieldDeclaration fieldDeclaration, T data)
 {
     return(VisitChildren(fieldDeclaration, data));
 }
Example #5
0
 public override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)
 {
     // skip
 }
 public virtual S VisitFieldDeclaration(FieldDeclaration fieldDeclaration, T data)
 {
     throw new NotImplementedException();
 }