public async Task <List <MSBuildCodeFix> > GetRefactorings(
            MSBuildParseResult result,
            SnapshotSpan selectedSpan,
            CancellationToken cancellationToken)
        {
            var refactorings = new List <MSBuildCodeFix> ();

            void ReportRefactoring(MSBuildAction a)
            {
                lock (refactorings) {
                    refactorings.Add(new MSBuildCodeFix(a, ImmutableArray <MSBuildDiagnostic> .Empty));
                }
            }

            var context = new MSBuildRefactoringContext(
                result.MSBuildDocument,
                new Xml.Dom.TextSpan(selectedSpan.Start, selectedSpan.Length),
                ReportRefactoring,
                cancellationToken);

            foreach (var provider in refactoringProviders)
            {
                if (cancellationToken.IsCancellationRequested)
                {
                    return(null);
                }
                await provider.RegisterRefactoringsAsync(context);
            }

            return(refactorings);
        }
        public async Task <bool> HasRefactorings(MSBuildParseResult result, SnapshotSpan selectedSpan, CancellationToken cancellationToken)
        {
            bool foundRefactoring = false;

            void ReportRefactoring(MSBuildAction a) => foundRefactoring = true;

            var context = new MSBuildRefactoringContext(
                result.MSBuildDocument,
                new Xml.Dom.TextSpan(selectedSpan.Start, selectedSpan.Length),
                ReportRefactoring,
                cancellationToken);

            foreach (var provider in refactoringProviders)
            {
                if (cancellationToken.IsCancellationRequested)
                {
                    return(false);
                }
                await provider.RegisterRefactoringsAsync(context);

                if (foundRefactoring)
                {
                    return(true);
                }
            }

            return(false);
        }
 public abstract Task RegisterRefactoringsAsync(MSBuildRefactoringContext context);