public async Task ComputeRefactoringsForNodeAsync()
        {
            SyntaxNode node = Root.FindNode(Span, findInsideTrivia: false, getInnermostNodeForTie: true);

            if (node == null)
            {
                return;
            }

            bool fAccessor               = false;
            bool fArgument               = false;
            bool fArgumentList           = false;
            bool fAttributeArgumentList  = false;
            bool fArrowExpressionClause  = false;
            bool fParameter              = false;
            bool fParameterList          = false;
            bool fSwitchSection          = false;
            bool fVariableDeclaration    = false;
            bool fInterpolatedStringText = false;
            bool fElseClause             = false;
            bool fCaseSwitchLabel        = false;
            bool fUsingDirective         = false;

            bool fExpression                   = false;
            bool fAnonymousMethod              = false;
            bool fAssignmentExpression         = false;
            bool fBinaryExpression             = false;
            bool fConditionalExpression        = false;
            bool fQualifiedName                = false;
            bool fGenericName                  = false;
            bool fIdentifierName               = false;
            bool fInitializerExpression        = false;
            bool fInterpolatedStringExpression = false;
            bool fInterpolation                = false;
            bool fInvocationExpression         = false;
            bool fLambdaExpression             = false;
            bool fLiteralExpression            = false;
            bool fSimpleMemberAccessExpression = false;
            bool fParenthesizedExpression      = false;
            bool fPostfixUnaryExpression       = false;
            bool fPrefixUnaryExpression        = false;
            bool fAwaitExpression              = false;
            bool fCastExpression               = false;
            bool fThrowExpression              = false;
            bool fDeclarationExpression        = false;

            bool fMemberDeclaration         = false;
            bool fStatement                 = false;
            bool fDoStatement               = false;
            bool fExpressionStatement       = false;
            bool fForEachStatement          = false;
            bool fForStatement              = false;
            bool fIfStatement               = false;
            bool fLocalDeclarationStatement = false;
            bool fReturnStatement           = false;
            bool fSwitchStatement           = false;
            bool fUsingStatement            = false;
            bool fWhileStatement            = false;
            bool fYieldReturnStatement      = false;
            bool fLockStatement             = false;
            bool fBlock = false;
            bool fStatementRefactoring = false;
            bool fThrowStatement       = false;

            SyntaxNode firstNode = node;

            using (IEnumerator <SyntaxNode> en = node.AncestorsAndSelf().GetEnumerator())
            {
                while (en.MoveNext())
                {
                    node = en.Current;

                    SyntaxKind kind = node.Kind();

                    Debug.WriteLine(kind.ToString());

                    if (!fAccessor)
                    {
                        var accessor = node as AccessorDeclarationSyntax;
                        if (accessor != null)
                        {
                            AccessorDeclarationRefactoring.ComputeRefactorings(this, accessor);
                            fAccessor = true;
                            continue;
                        }
                    }

                    if (!fArgument &&
                        kind == SyntaxKind.Argument)
                    {
                        await ArgumentRefactoring.ComputeRefactoringsAsync(this, (ArgumentSyntax)node).ConfigureAwait(false);

                        fArgument = true;
                        continue;
                    }

                    if (!fArgumentList &&
                        kind == SyntaxKind.ArgumentList)
                    {
                        await ArgumentListRefactoring.ComputeRefactoringsAsync(this, (ArgumentListSyntax)node).ConfigureAwait(false);

                        fArgumentList = true;
                        continue;
                    }

                    if (!fAttributeArgumentList &&
                        kind == SyntaxKind.AttributeArgumentList)
                    {
                        await AttributeArgumentListRefactoring.ComputeRefactoringsAsync(this, (AttributeArgumentListSyntax)node).ConfigureAwait(false);

                        fAttributeArgumentList = true;
                        continue;
                    }

                    if (!fArrowExpressionClause &&
                        kind == SyntaxKind.ArrowExpressionClause)
                    {
                        await ArrowExpressionClauseRefactoring.ComputeRefactoringsAsync(this, (ArrowExpressionClauseSyntax)node).ConfigureAwait(false);

                        fArrowExpressionClause = true;
                        continue;
                    }

                    if (!fParameter &&
                        kind == SyntaxKind.Parameter)
                    {
                        await ParameterRefactoring.ComputeRefactoringsAsync(this, (ParameterSyntax)node).ConfigureAwait(false);

                        fParameter = true;
                        continue;
                    }

                    if (!fParameterList &&
                        kind == SyntaxKind.ParameterList)
                    {
                        await ParameterListRefactoring.ComputeRefactoringsAsync(this, (ParameterListSyntax)node).ConfigureAwait(false);

                        fParameterList = true;
                        continue;
                    }

                    if (!fSwitchSection &&
                        kind == SyntaxKind.SwitchSection)
                    {
                        await SwitchSectionRefactoring.ComputeRefactoringsAsync(this, (SwitchSectionSyntax)node).ConfigureAwait(false);

                        fSwitchSection = true;
                        continue;
                    }

                    if (!fVariableDeclaration &&
                        kind == SyntaxKind.VariableDeclaration)
                    {
                        await VariableDeclarationRefactoring.ComputeRefactoringsAsync(this, (VariableDeclarationSyntax)node).ConfigureAwait(false);

                        fVariableDeclaration = true;
                        continue;
                    }

                    if (!fInterpolatedStringText &&
                        kind == SyntaxKind.InterpolatedStringText)
                    {
                        InterpolatedStringTextRefactoring.ComputeRefactorings(this, (InterpolatedStringTextSyntax)node);
                        fInterpolatedStringText = true;
                        continue;
                    }

                    if (!fInterpolation &&
                        kind == SyntaxKind.Interpolation)
                    {
                        InterpolationRefactoring.ComputeRefactorings(this, (InterpolationSyntax)node);
                        fInterpolation = true;
                        continue;
                    }

                    if (!fElseClause &&
                        kind == SyntaxKind.ElseClause)
                    {
                        ElseClauseRefactoring.ComputeRefactorings(this, (ElseClauseSyntax)node);
                        fElseClause = true;
                        continue;
                    }

                    if (!fCaseSwitchLabel &&
                        kind == SyntaxKind.CaseSwitchLabel)
                    {
                        await CaseSwitchLabelRefactoring.ComputeRefactoringsAsync(this, (CaseSwitchLabelSyntax)node).ConfigureAwait(false);

                        fCaseSwitchLabel = true;
                        continue;
                    }

                    if (!fUsingDirective &&
                        kind == SyntaxKind.UsingDirective)
                    {
                        UsingDirectiveRefactoring.ComputeRefactoring(this, (UsingDirectiveSyntax)node);
                        fUsingDirective = true;
                        continue;
                    }

                    var expression = node as ExpressionSyntax;
                    if (expression != null)
                    {
                        if (!fExpression)
                        {
                            await ExpressionRefactoring.ComputeRefactoringsAsync(this, expression).ConfigureAwait(false);

                            fExpression = true;
                        }

                        if (!fAssignmentExpression)
                        {
                            var assignmentExpression = node as AssignmentExpressionSyntax;
                            if (assignmentExpression != null)
                            {
                                await AssignmentExpressionRefactoring.ComputeRefactoringsAsync(this, assignmentExpression).ConfigureAwait(false);

                                fAssignmentExpression = true;
                            }
                        }

                        if (!fAnonymousMethod &&
                            kind == SyntaxKind.AnonymousMethodExpression)
                        {
                            AnonymousMethodExpressionRefactoring.ComputeRefactorings(this, (AnonymousMethodExpressionSyntax)node);
                            fAnonymousMethod = true;
                        }

                        if (!fBinaryExpression)
                        {
                            var binaryExpression = node as BinaryExpressionSyntax;
                            if (binaryExpression != null)
                            {
                                await BinaryExpressionRefactoring.ComputeRefactoringsAsync(this, binaryExpression).ConfigureAwait(false);

                                fBinaryExpression = true;
                            }
                        }

                        if (!fConditionalExpression &&
                            kind == SyntaxKind.ConditionalExpression)
                        {
                            await ConditionalExpressionRefactoring.ComputeRefactoringsAsync(this, (ConditionalExpressionSyntax)expression).ConfigureAwait(false);

                            fConditionalExpression = true;
                        }

                        if (!fQualifiedName &&
                            kind == SyntaxKind.QualifiedName)
                        {
                            await QualifiedNameRefactoring.ComputeRefactoringsAsync(this, (QualifiedNameSyntax)expression).ConfigureAwait(false);

                            fQualifiedName = true;
                        }

                        if (!fGenericName &&
                            kind == SyntaxKind.GenericName)
                        {
                            GenericNameRefactoring.ComputeRefactorings(this, (GenericNameSyntax)expression);
                            fGenericName = true;
                        }

                        if (!fIdentifierName &&
                            kind == SyntaxKind.IdentifierName)
                        {
                            await IdentifierNameRefactoring.ComputeRefactoringsAsync(this, (IdentifierNameSyntax)expression).ConfigureAwait(false);

                            fIdentifierName = true;
                        }

                        if (!fInitializerExpression)
                        {
                            var initializer = node as InitializerExpressionSyntax;
                            if (initializer != null)
                            {
                                await InitializerExpressionRefactoring.ComputeRefactoringsAsync(this, initializer).ConfigureAwait(false);

                                fInitializerExpression = true;
                            }
                        }

                        if (!fInterpolatedStringExpression &&
                            kind == SyntaxKind.InterpolatedStringExpression)
                        {
                            InterpolatedStringRefactoring.ComputeRefactorings(this, (InterpolatedStringExpressionSyntax)expression);
                            fInterpolatedStringExpression = true;
                        }

                        if (!fInvocationExpression &&
                            kind == SyntaxKind.InvocationExpression)
                        {
                            await InvocationExpressionRefactoring.ComputeRefactoringsAsync(this, (InvocationExpressionSyntax)expression).ConfigureAwait(false);

                            fInvocationExpression = true;
                        }

                        if (!fLambdaExpression)
                        {
                            var lambdaExpression = node as LambdaExpressionSyntax;
                            if (lambdaExpression != null)
                            {
                                LambdaExpressionRefactoring.ComputeRefactorings(this, lambdaExpression);
                                fLambdaExpression = true;
                            }
                        }

                        if (!fLiteralExpression)
                        {
                            var literalExpression = node as LiteralExpressionSyntax;
                            if (literalExpression != null)
                            {
                                await LiteralExpressionRefactoring.ComputeRefactoringsAsync(this, literalExpression).ConfigureAwait(false);

                                fLiteralExpression = true;
                            }
                        }

                        if (!fSimpleMemberAccessExpression &&
                            kind == SyntaxKind.SimpleMemberAccessExpression)
                        {
                            await SimpleMemberAccessExpressionRefactoring.ComputeRefactoringAsync(this, (MemberAccessExpressionSyntax)node).ConfigureAwait(false);

                            fSimpleMemberAccessExpression = true;
                        }

                        if (!fParenthesizedExpression &&
                            kind == SyntaxKind.ParenthesizedExpression)
                        {
                            ParenthesizedExpressionRefactoring.ComputeRefactorings(this, (ParenthesizedExpressionSyntax)expression);
                            fParenthesizedExpression = true;
                        }

                        if (!fPostfixUnaryExpression)
                        {
                            var postfixUnaryExpression = node as PostfixUnaryExpressionSyntax;
                            if (postfixUnaryExpression != null)
                            {
                                PostfixUnaryExpressionRefactoring.ComputeRefactorings(this, postfixUnaryExpression);
                                fPostfixUnaryExpression = true;
                            }
                        }

                        if (!fPrefixUnaryExpression)
                        {
                            var prefixUnaryExpression = node as PrefixUnaryExpressionSyntax;
                            if (prefixUnaryExpression != null)
                            {
                                PrefixUnaryExpressionRefactoring.ComputeRefactorings(this, prefixUnaryExpression);
                                fPrefixUnaryExpression = true;
                            }
                        }

                        if (!fAwaitExpression &&
                            kind == SyntaxKind.AwaitExpression)
                        {
                            await AwaitExpressionRefactoring.ComputeRefactoringsAsync(this, (AwaitExpressionSyntax)node).ConfigureAwait(false);

                            fAwaitExpression = true;
                        }

                        if (!fCastExpression &&
                            kind == SyntaxKind.CastExpression)
                        {
                            CastExpressionRefactoring.ComputeRefactorings(this, (CastExpressionSyntax)node);
                            fCastExpression = true;
                        }

                        if (!fThrowExpression &&
                            kind == SyntaxKind.ThrowExpression)
                        {
                            await ThrowExpressionRefactoring.ComputeRefactoringsAsync(this, (ThrowExpressionSyntax)node).ConfigureAwait(false);

                            fThrowExpression = true;
                        }

                        if (!fDeclarationExpression &&
                            kind == SyntaxKind.DeclarationExpression)
                        {
                            await DeclarationExpressionRefactoring.ComputeRefactoringsAsync(this, (DeclarationExpressionSyntax)node).ConfigureAwait(false);

                            fDeclarationExpression = true;
                        }

                        continue;
                    }

                    var memberDeclaration = node as MemberDeclarationSyntax;
                    if (memberDeclaration != null)
                    {
                        if (!fMemberDeclaration)
                        {
                            await MemberDeclarationRefactoring.ComputeRefactoringsAsync(this, memberDeclaration).ConfigureAwait(false);

                            AttributeListRefactoring.ComputeRefactorings(this, memberDeclaration);
                            await IntroduceConstructorRefactoring.ComputeRefactoringsAsync(this, memberDeclaration).ConfigureAwait(false);

                            fMemberDeclaration = true;
                        }

                        continue;
                    }

                    var statement = node as StatementSyntax;
                    if (statement != null)
                    {
                        if (!fDoStatement &&
                            kind == SyntaxKind.DoStatement)
                        {
                            DoStatementRefactoring.ComputeRefactorings(this, (DoStatementSyntax)statement);
                            fDoStatement = true;
                        }

                        if (!fExpressionStatement &&
                            kind == SyntaxKind.ExpressionStatement)
                        {
                            await ExpressionStatementRefactoring.ComputeRefactoringsAsync(this, (ExpressionStatementSyntax)statement).ConfigureAwait(false);

                            fExpressionStatement = true;
                        }

                        if (!fForEachStatement &&
                            kind == SyntaxKind.ForEachStatement)
                        {
                            await ForEachStatementRefactoring.ComputeRefactoringsAsync(this, (ForEachStatementSyntax)statement).ConfigureAwait(false);

                            fForEachStatement = true;
                        }

                        if (!fForStatement &&
                            kind == SyntaxKind.ForStatement)
                        {
                            await ForStatementRefactoring.ComputeRefactoringsAsync(this, (ForStatementSyntax)statement).ConfigureAwait(false);

                            fForStatement = true;
                        }

                        if (!fIfStatement &&
                            kind == SyntaxKind.IfStatement)
                        {
                            await IfStatementRefactoring.ComputeRefactoringsAsync(this, (IfStatementSyntax)statement).ConfigureAwait(false);

                            fIfStatement = true;
                        }

                        if (!fLocalDeclarationStatement &&
                            kind == SyntaxKind.LocalDeclarationStatement)
                        {
                            await LocalDeclarationStatementRefactoring.ComputeRefactoringsAsync(this, (LocalDeclarationStatementSyntax)statement).ConfigureAwait(false);

                            fLocalDeclarationStatement = true;
                        }

                        if (!fReturnStatement &&
                            kind == SyntaxKind.ReturnStatement)
                        {
                            await ReturnStatementRefactoring.ComputeRefactoringsAsync(this, (ReturnStatementSyntax)statement).ConfigureAwait(false);

                            fReturnStatement = true;
                        }

                        if (!fSwitchStatement &&
                            kind == SyntaxKind.SwitchStatement)
                        {
                            await SwitchStatementRefactoring.ComputeRefactoringsAsync(this, (SwitchStatementSyntax)statement).ConfigureAwait(false);

                            fSwitchStatement = true;
                        }

                        if (!fUsingStatement &&
                            kind == SyntaxKind.UsingStatement)
                        {
                            await UsingStatementRefactoring.ComputeRefactoringsAsync(this, (UsingStatementSyntax)statement).ConfigureAwait(false);

                            fUsingStatement = true;
                        }

                        if (!fWhileStatement &&
                            kind == SyntaxKind.WhileStatement)
                        {
                            WhileStatementRefactoring.ComputeRefactorings(this, (WhileStatementSyntax)statement);
                            fWhileStatement = true;
                        }

                        if (!fYieldReturnStatement)
                        {
                            var yieldStatement = node as YieldStatementSyntax;
                            if (yieldStatement != null)
                            {
                                await YieldStatementRefactoring.ComputeRefactoringsAsync(this, yieldStatement).ConfigureAwait(false);

                                fYieldReturnStatement = true;
                            }
                        }

                        if (!fLockStatement &&
                            kind == SyntaxKind.LockStatement)
                        {
                            LockStatementRefactoring.ComputeRefactorings(this, (LockStatementSyntax)node);
                            fLockStatement = true;
                        }

                        if (!fBlock &&
                            kind == SyntaxKind.Block)
                        {
                            await BlockRefactoring.ComputeRefactoringAsync(this, (BlockSyntax)node).ConfigureAwait(false);

                            fBlock = true;
                        }

                        if (!fThrowStatement &&
                            kind == SyntaxKind.ThrowStatement)
                        {
                            await ThrowStatementRefactoring.ComputeRefactoringAsync(this, (ThrowStatementSyntax)node).ConfigureAwait(false);

                            fThrowStatement = true;
                        }

                        if (!fStatement)
                        {
                            AddBracesRefactoring.ComputeRefactoring(this, statement);
                            RemoveBracesRefactoring.ComputeRefactoring(this, statement);
                            ExtractStatementRefactoring.ComputeRefactoring(this, statement);
                            fStatement = true;
                        }

                        if (!fStatementRefactoring)
                        {
                            if (kind == SyntaxKind.Block)
                            {
                                StatementRefactoring.ComputeRefactoring(this, (BlockSyntax)node);
                                fStatementRefactoring = true;
                            }
                            else if (kind == SyntaxKind.SwitchStatement)
                            {
                                StatementRefactoring.ComputeRefactoring(this, (SwitchStatementSyntax)node);
                                fStatementRefactoring = true;
                            }
                        }

                        continue;
                    }
                }
            }

            await SyntaxNodeRefactoring.ComputeRefactoringsAsync(this, firstNode).ConfigureAwait(false);

            CommentTriviaRefactoring.ComputeRefactorings(this, firstNode);
        }