public static IRefactoringWarningMessage CreateRefactoringWarningMessage(IDocument document, CodeIssue issue, ICodeIssueComputer computer) { var instance = new RefactoringWarningMessage { File = document.Name, Line = document.GetText().GetLineFromPosition(issue.TextSpan.Start).LineNumber, Description = issue.Description, CodeIssueComputer = computer }; return instance; }
public override bool Equals(ICodeIssueComputer o) { var other = o as UnchangedMethodInvocationComputer; if (other != null) { var comparator = new MethodsComparator(); return comparator.Compare(declaration, other.declaration) == 0; } return false; }
private IEnumerable<CodeIssue> ComputerAllCodeIssues(ICodeIssueComputer computer, IDocument document) { var root = (SyntaxNode)document.GetSyntaxRoot(); return root.DescendantNodes().SelectMany(n => computer.ComputeCodeIssues(document, n)); }
public bool IsBlack(ICodeIssueComputer computer) { return blackList.Contains(computer); }
internal ModifiedFlowOutDataFix(IDocument document, SyntaxNode methodAfter, SyntaxNode inlinedMethod, SyntaxNode inlinedMethodInvocation, IEnumerable<SyntaxNode> inlinedStatements, IEnumerable<ISymbol> addedSymbols, IEnumerable<ISymbol> missingSymbols, ICodeIssueComputer computer) { this.document = document; this.methodAfter = methodAfter; this.inlinedMethod = inlinedMethod; this.inlinedMethodInvocation = inlinedMethodInvocation; this.inlinedStatements = inlinedStatements; this.addedSymbols = addedSymbols; this.missingSymbols = missingSymbols; this.computer = computer; this.logger = NLoggerUtil.GetNLogger(typeof(ModifiedFlowOutDataFix)); }
public void Add(ICodeIssueComputer computer) { if (blackList.Count() == maxCount) { blackList.RemoveAt(maxCount - 1); } blackList.Add(computer); }
public static ICodeActionOperation GetRemoveCodeIssueComputerOperation(ICodeIssueComputer computer) { return new RemoveCodeIssueComputerOperation(computer); }
public override bool Equals(ICodeIssueComputer o) { if (IsIssuedToSameDocument(o)) { var other = o as UnchangedMethodInvocationComputer; if (other != null) { var comparator = new MethodNameComparer(); return comparator.Compare(declaration, other.declaration) == 0; } } return false; }
public override bool Equals(ICodeIssueComputer o) { if (IsIssuedToSameDocument(o)) { // If the other is not in the same RefactoringType, return false var other = o as ReturnTypeCheckingResult; if (other != null) { if(methodNameComparer.Compare(declaration, other.declaration) == 0) { return ConditionCheckersUtils.AreStringTuplesSame(typeNameTuples, other.typeNameTuples); } } } return false; }
public RemoveCodeIssueComputerOperation(ICodeIssueComputer computer) { this.computer = computer; }
internal AddReturnValueCodeAction(IDocument document, SyntaxNode declaration, SyntaxNode invocation, Tuple<string, string> typeNameTuple, ICodeIssueComputer computer) { this.document = document; this.declaration = declaration; this.invocation = invocation; this.typeNameTuple = typeNameTuple; this.computer = computer; }
public override bool Equals(ICodeIssueComputer o) { if (IsIssuedToSameDocument(o)) { var another = o as ParameterCheckingCodeIssueComputer; // If the other is not in the same RefactoringType, return false if (another != null) { var other = (ParameterCheckingCodeIssueComputer) o; var methodsComparator = new MethodNameComparer(); // If the method declarations are equal to each other, compare the missing // parameters. if(methodsComparator.Compare(declaration, other.declaration) == 0) { return ConditionCheckersUtils.AreStringTuplesSame(typeNameTuples, other.typeNameTuples); } } } return false; }
internal CorrectAllSignaturesInSolution(IDocument document, SyntaxNode declaration, IEnumerable<Tuple<int, int>> mappings, ICodeIssueComputer computer) { this.document = document; this.declaration = declaration; this.mappings = mappings; this.computer = computer; }
public override bool Equals(ICodeIssueComputer o) { // If the other is not in the same RefactoringType, return false if (o is ReturnTypeCheckingResult) { var other = (ReturnTypeCheckingResult) o; var methodsComparator = new MethodsComparator(); var stringEnumerablesComparator = new StringEnumerablesComparator(); // If the method declarations are equal to each other. return methodsComparator.Compare(declaration, other.declaration) == 0 && // Also the contained return names are equal to each other, return true; stringEnumerablesComparator.Compare(typeNameTuples.Select(t => t.Item2), other.typeNameTuples.Select(t => t.Item2)) == 0; } return false; }
public override bool Equals(ICodeIssueComputer o) { if (IsIssuedToSameDocument(o)) { var other = o as ModifiedFlowOutDataIssueComputer; if (other != null) { if (ConditionCheckersUtils.AreSymbolListsEqual(other.missingSymbols, missingSymbols)) { if (ConditionCheckersUtils.AreSymbolListsEqual(other. addedSymbols, addedSymbols)) { return true; } } } } return false; }
public override bool Equals(ICodeIssueComputer o) { if(o is ModifiedFlowOutData) { var other = (ModifiedFlowOutData) o; if(ConditionCheckersUtils.CompareSymbolListByName(other.missingSymbols, this.missingSymbols)) { if(ConditionCheckersUtils.CompareSymbolListByName(other.addedSymbols, this.addedSymbols)) { return true; } } } return false; }
public CorrectSignatureCodeAction(IDocument document, SyntaxNode invocation, IEnumerable<Tuple<int, int>> mappings, ICodeIssueComputer computer) { this.document = document; this.invocation = (InvocationExpressionSyntax) invocation; this.mappings = mappings; this.computer = computer; }