Example #1
0
        internal static IEnumerable <KeyValuePair <SyntaxNode, SyntaxNode> > GetMethodMatches(string src1, string src2, ParseOptions options = null, StateMachineKind stateMachine = StateMachineKind.None)
        {
            var methodMatch = GetMethodMatch(src1, src2, options, stateMachine);

            bool hasLambda;
            Dictionary <SyntaxNode, AbstractEditAndContinueAnalyzer.LambdaInfo> lazyActiveOrMatchedLambdas = null;
            var reverseMap = Analyzer.ComputeReverseMap(methodMatch, new AbstractEditAndContinueAnalyzer.ActiveNode[0], ref lazyActiveOrMatchedLambdas, new List <RudeEditDiagnostic>(), out hasLambda);

            var result = new Dictionary <SyntaxNode, SyntaxNode>();

            foreach (var pair in reverseMap)
            {
                if (pair.Key == methodMatch.NewRoot)
                {
                    Assert.Same(pair.Value, methodMatch.OldRoot);
                    continue;
                }

                result.Add(pair.Value, pair.Key);
            }

            return(result);
        }