public sealed override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
    {
      // TODO: Replace the following code with your own analysis, generating a CodeAction for each refactoring to offer

      var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);

      // Find the node at the selection.
      var node = root.FindNode(context.Span);

      var navigator = new NodeNavigator(node);

      // Only offer a refactoring if the selected node is a type declaration node.
      var expr =
        navigator.FindInAncestors<ObjectCreationExpressionSyntax>() ??
        navigator.FindInDescendents<ObjectCreationExpressionSyntax>().FirstOrDefault();

      if (expr == null) return;

      // For any type declaration node, create a code action to reverse the identifier text.
      // var action = CodeAction.Create("Reverse type name", c => ReverseTypeNameAsync(context.Document, typeDecl, c));

      // Register this code action.
      // context.RegisterRefactoring(action);
    }
        public void NodeNavigator_Selection_FindInParents_ClassDeclarationSyntax_ReturnsNull(string code, int selectionStart, int selectionLength)
        {
            // Arrange
              var tree = CSharpSyntaxTree.ParseText(code);
              var root = tree.GetCompilationUnitRoot();
              var selection = root.FindNode(new TextSpan(selectionStart, selectionLength));

              var nn = new NodeNavigator(selection);

              // Act
              var node = nn.FindInAncestors<ClassDeclarationSyntax>();

              // Assert
              Assert.AreEqual("C", node.Identifier.Text);
        }