コード例 #1
0
 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;
 }
コード例 #2
0
 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;
 }
コード例 #3
0
 private IEnumerable<CodeIssue> ComputerAllCodeIssues(ICodeIssueComputer computer, IDocument document)
 {
     var root = (SyntaxNode)document.GetSyntaxRoot();
     return root.DescendantNodes().SelectMany(n => computer.ComputeCodeIssues(document, n));
 }
コード例 #4
0
 public bool IsBlack(ICodeIssueComputer computer)
 {
     return blackList.Contains(computer);
 }
コード例 #5
0
 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));
 }
コード例 #6
0
 public void Add(ICodeIssueComputer computer)
 {
     if (blackList.Count() == maxCount)
     {
         blackList.RemoveAt(maxCount - 1);
     }
     blackList.Add(computer);
 }
コード例 #7
0
 public static ICodeActionOperation GetRemoveCodeIssueComputerOperation(ICodeIssueComputer computer)
 {
     return new RemoveCodeIssueComputerOperation(computer);
 }
コード例 #8
0
 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;
 }
コード例 #9
0
 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;
 }
コード例 #10
0
 public RemoveCodeIssueComputerOperation(ICodeIssueComputer computer)
 {
     this.computer = computer;
 }
コード例 #11
0
 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;
 }
コード例 #12
0
                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;
                }
コード例 #13
0
 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;
 }
コード例 #14
0
                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;
                }
コード例 #15
0
 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;
 }
コード例 #16
0
 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;
 }
コード例 #17
0
 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;
 }