private async Task ComputeRefactoringsAsync(CodeRefactoringContext context, MethodDeclarationSyntax methodDeclaration)
        {
            if (methodDeclaration.HeaderSpan().Contains(context.Span))
            {
                if (MethodDeclarationRefactoring.CanConvertToReadOnlyProperty(methodDeclaration))
                {
                    context.RegisterRefactoring(
                        "Convert to read-only property",
                        cancellationToken => MethodDeclarationRefactoring.ConvertToReadOnlyPropertyAsync(context.Document, methodDeclaration, cancellationToken));
                }

                if (MakeMemberAbstractRefactoring.CanRefactor(context, methodDeclaration))
                {
                    context.RegisterRefactoring(
                        "Make method abstract",
                        cancellationToken => MakeMemberAbstractRefactoring.RefactorAsync(context.Document, methodDeclaration, cancellationToken));
                }
            }

            if (context.Document.SupportsSemanticModel)
            {
                SemanticModel semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken);

                MethodDeclarationRefactoring.RenameAccordingToTypeName(methodDeclaration, context, semanticModel);
            }
        }
 private void ComputeRefactorings(CodeRefactoringContext context, IndexerDeclarationSyntax indexerDeclaration)
 {
     if (indexerDeclaration.HeaderSpan().Contains(context.Span) &&
         MakeMemberAbstractRefactoring.CanRefactor(context, indexerDeclaration))
     {
         context.RegisterRefactoring(
             "Make indexer abstract",
             cancellationToken => MakeMemberAbstractRefactoring.RefactorAsync(context.Document, indexerDeclaration, cancellationToken));
     }
 }
        private async Task ComputeRefactoringsAsync(CodeRefactoringContext context, PropertyDeclarationSyntax propertyDeclaration)
        {
            if (propertyDeclaration.HeaderSpan().Contains(context.Span) &&
                PropertyDeclarationRefactoring.CanConvertToMethod(propertyDeclaration))
            {
                context.RegisterRefactoring(
                    "Convert to method",
                    cancellationToken => PropertyDeclarationRefactoring.ConvertToMethodAsync(context.Document, propertyDeclaration, cancellationToken));
            }

            if (context.Document.SupportsSemanticModel)
            {
                SemanticModel semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken);

                if (PropertyDeclarationRefactoring.CanExpand(propertyDeclaration, semanticModel, context.CancellationToken))
                {
                    context.RegisterRefactoring(
                        "Expand property",
                        cancellationToken => PropertyDeclarationRefactoring.ExpandPropertyAsync(context.Document, propertyDeclaration, cancellationToken));

                    context.RegisterRefactoring(
                        "Expand property and add backing field",
                        cancellationToken => PropertyDeclarationRefactoring.ExpandPropertyAndAddBackingFieldAsync(context.Document, propertyDeclaration, cancellationToken));
                }

                NotifyPropertyChangedRefactoring.Refactor(propertyDeclaration, context, semanticModel);
            }

            if (propertyDeclaration.HeaderSpan().Contains(context.Span) &&
                MakeMemberAbstractRefactoring.CanRefactor(context, propertyDeclaration))
            {
                context.RegisterRefactoring(
                    "Make property abstract",
                    cancellationToken => MakeMemberAbstractRefactoring.RefactorAsync(context.Document, propertyDeclaration, cancellationToken));
            }

            if (context.Document.SupportsSemanticModel)
            {
                SemanticModel semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken);

                PropertyDeclarationRefactoring.RenameAccordingToTypeName(propertyDeclaration, context, semanticModel);
            }

            if (propertyDeclaration.Initializer != null)
            {
                context.RegisterRefactoring(
                    "Remove initializer",
                    cancellationToken => PropertyDeclarationRefactoring.RemoveInitializerAsync(context.Document, propertyDeclaration, cancellationToken));
            }
        }