Exemplo n.º 1
0
        public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
        {
            SyntaxNode root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);

#if DEBUG
            try
            {
#endif
            var refactoringContext = new RefactoringContext(context, root, RefactoringSettings.Current);

            await refactoringContext.ComputeRefactoringsAsync().ConfigureAwait(false);

#if DEBUG
        }

        catch (Exception ex) when(!(ex is OperationCanceledException))
        {
            Debug.Fail(nameof(RoslynatorCodeRefactoringProvider));
            throw;
        }
#endif
        }
        public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
        {
            SyntaxNode root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);

#if DEBUG
            try
            {
#endif
            var refactoringContext = new RefactoringContext(context, root, DefaultSettings);

            await refactoringContext.ComputeRefactoringsAsync().ConfigureAwait(false);

#if DEBUG
        }

        catch (Exception ex)
        {
            Debug.WriteLine(ex.ToString());
            Debug.Assert(false, nameof(RoslynatorCodeRefactoringProvider));
            throw;
        }
#endif
        }
Exemplo n.º 3
0
 private static async Task ComputeRefactoringsAsync(RefactoringContext context)
 {
     await context.ComputeRefactoringsAsync().ConfigureAwait(false);
 }