示例#1
0
            > DetermineDiagnosticsAsync(FixAllContext fixAllContext, IProgressTracker progressTracker)
        {
            using var _ = progressTracker.ItemCompletedScope();

            var documentToDiagnostics = await fixAllContext
                                        .GetDocumentDiagnosticsToFixAsync()
                                        .ConfigureAwait(false);

            var filtered = documentToDiagnostics.Where(
                kvp =>
            {
                if (kvp.Key.Project != fixAllContext.Project)
                {
                    return(false);
                }

                if (fixAllContext.Document != null && fixAllContext.Document != kvp.Key)
                {
                    return(false);
                }

                return(true);
            }
                );

            return(filtered.ToImmutableDictionary());
        }
示例#2
0
 public override async Task<CodeAction> GetFixAsync(FixAllContext fixAllContext)
 {
     if (fixAllContext.Document != null)
     {
         var documentsAndDiagnosticsToFixMap = await fixAllContext.GetDocumentDiagnosticsToFixAsync().ConfigureAwait(false);
         return await GetFixAsync(documentsAndDiagnosticsToFixMap, fixAllContext.State, fixAllContext.CancellationToken).ConfigureAwait(false);
     }
     else
     {
         var projectsAndDiagnosticsToFixMap = await fixAllContext.GetProjectDiagnosticsToFixAsync().ConfigureAwait(false);
         return await GetFixAsync(projectsAndDiagnosticsToFixMap, fixAllContext.State, fixAllContext.CancellationToken).ConfigureAwait(false);
     }
 }
示例#3
0
        public override async Task <CodeAction> GetFixAsync(FixAllContext fixAllContext)
        {
            if (fixAllContext.Document != null)
            {
                var documentsAndDiagnosticsToFixMap = await fixAllContext.GetDocumentDiagnosticsToFixAsync().ConfigureAwait(false);

                return(await GetFixAsync(documentsAndDiagnosticsToFixMap, fixAllContext.State, fixAllContext.CancellationToken).ConfigureAwait(false));
            }
            else
            {
                var projectsAndDiagnosticsToFixMap = await fixAllContext.GetProjectDiagnosticsToFixAsync().ConfigureAwait(false);

                return(await GetFixAsync(projectsAndDiagnosticsToFixMap, fixAllContext.State, fixAllContext.CancellationToken).ConfigureAwait(false));
            }
        }
            public sealed override async Task <CodeAction> GetFixAsync(FixAllContext fixAllContext)
            {
                var documentsAndDiagnosticsToFixMap = await fixAllContext.GetDocumentDiagnosticsToFixAsync().ConfigureAwait(false);

                return(await GetFixAsync(documentsAndDiagnosticsToFixMap, fixAllContext.State, fixAllContext.CancellationToken).ConfigureAwait(false));
            }
 public sealed override async Task<CodeAction> GetFixAsync(FixAllContext fixAllContext)
 {
     var documentsAndDiagnosticsToFixMap = await fixAllContext.GetDocumentDiagnosticsToFixAsync().ConfigureAwait(false);
     return await GetFixAsync(documentsAndDiagnosticsToFixMap, fixAllContext.State, fixAllContext.CancellationToken).ConfigureAwait(false);
 }