protected internal Init(NRefactory.VariableInitializer variableInitializer, IScope scope, INRefcatoryExpressionVisitor visitor) : base(scope, visitor) { NRefactory.Expression initializer = null; _variableInitializer = variableInitializer; initializer = variableInitializer.Initializer; }
public override void VisitVariableInitializer(VariableInitializer variableInitializer) { if (!variableInitializer.AssignToken.IsNull) { ForceSpacesAround(variableInitializer.AssignToken, policy.SpaceAroundAssignment); } if (!variableInitializer.Initializer.IsNull) { int extraSpaces = 0; var useExtraSpaces = variableInitializer.AssignToken.StartLocation.Line == variableInitializer.Initializer.StartLocation.Line; if (useExtraSpaces) { extraSpaces = Math.Max(0, variableInitializer.AssignToken.StartLocation.Column + 1 - curIndent.IndentString.Length); curIndent.ExtraSpaces += extraSpaces; } else { curIndent.Push(IndentType.Continuation); FixIndentation(variableInitializer.Initializer); } variableInitializer.Initializer.AcceptVisitor(this); if (useExtraSpaces) { curIndent.ExtraSpaces -= extraSpaces; } else { curIndent.Pop(); } } }
S IAstVisitor <T, S> .VisitVariableInitializer(VariableInitializer variableInitializer, T data) { var handler = VariableInitializerVisited; if (handler != null) { handler(variableInitializer, data); } return(VisitChildren(variableInitializer, data)); }
public override void VisitVariableInitializer(VariableInitializer variableInitializer) { if (!variableInitializer.AssignToken.IsNull) { ForceSpacesAround(variableInitializer.AssignToken, policy.SpaceAroundAssignment); } if (!variableInitializer.Initializer.IsNull) { variableInitializer.Initializer.AcceptVisitor(this); } }
private static List <AstNode> ComputeMatchNodes(RefactoringContext context, VariableInitializer firstOrNullObject) { var referenceFinder = new FindReferences(); var matchedNodes = new List <AstNode>(); var resolveResult = context.Resolver.Resolve(firstOrNullObject); var member = resolveResult as MemberResolveResult; if (member == null)//not a member is unexpected case, so is better to return no match than to break the code { return(matchedNodes); } FoundReferenceCallback callback = (matchNode, result) => matchedNodes.Add(matchNode); var searchScopes = referenceFinder.GetSearchScopes(member.Member); referenceFinder.FindReferencesInFile(searchScopes, context.UnresolvedFile, context.RootNode as SyntaxTree, context.Compilation, callback, context.CancellationToken); return(matchedNodes); }
void IAstVisitor.VisitVariableInitializer(VariableInitializer variableInitializer) { Visit(EnterVariableInitializer, LeaveVariableInitializer, variableInitializer); }
public virtual S VisitVariableInitializer(VariableInitializer variableInitializer, T data) { return(VisitChildren(variableInitializer, data)); }
public static Init Init(NRefactory.VariableInitializer variableInitializer, IScope scope, INRefcatoryExpressionVisitor visitor) { return(new Init(variableInitializer, scope, visitor)); }
public virtual S VisitVariableInitializer(VariableInitializer variableInitializer, T data) { throw new NotImplementedException(); }
public override AstExpression VisitVariableInitializer(NRefactory.VariableInitializer variableInitializer, IScope scope) { return(AstExpression.Init(variableInitializer, scope, this)); }