Exemplo n.º 1
0
        private FixAllState(
            FixAllProvider fixAllProvider,
            Document document,
            Project project,
            CodeFixProvider codeFixProvider,
            FixAllScope scope,
            string codeActionEquivalenceKey,
            IEnumerable <string> diagnosticIds,
            FixAllContext.DiagnosticProvider fixAllDiagnosticProvider)
        {
            Contract.ThrowIfNull(project);
            if (diagnosticIds == null)
            {
                throw new ArgumentNullException(nameof(diagnosticIds));
            }

            if (diagnosticIds.Any(d => d == null))
            {
                throw new ArgumentException(WorkspacesResources.Supplied_diagnostic_cannot_be_null, nameof(diagnosticIds));
            }

            this.FixAllProvider           = fixAllProvider;
            this.Document                 = document;
            this.Project                  = project;
            this.CodeFixProvider          = codeFixProvider ?? throw new ArgumentNullException(nameof(codeFixProvider));
            this.Scope                    = scope;
            this.CodeActionEquivalenceKey = codeActionEquivalenceKey;
            this.DiagnosticIds            = ImmutableHashSet.CreateRange(diagnosticIds);
            this.DiagnosticProvider       = fixAllDiagnosticProvider ?? throw new ArgumentNullException(nameof(fixAllDiagnosticProvider));
        }
Exemplo n.º 2
0
 private FixAllProviderInfo(
     FixAllProvider fixAllProvider,
     ImmutableArray <FixAllScope> supportedScopes)
 {
     FixAllProvider  = fixAllProvider;
     SupportedScopes = supportedScopes;
 }
Exemplo n.º 3
0
 public CodeFixerFixAllProviderInfo(
     FixAllProvider fixAllProvider,
     IEnumerable <string> supportedDiagnosticIds,
     ImmutableArray <FixAllScope> supportedScopes)
     : base(fixAllProvider, supportedScopes)
 {
     _supportedDiagnosticIds = supportedDiagnosticIds;
 }
Exemplo n.º 4
0
 public SuppressionFixerFixAllProviderInfo(
     FixAllProvider fixAllProvider,
     ISuppressionFixProvider suppressionFixer,
     ImmutableArray <FixAllScope> supportedScopes)
     : base(fixAllProvider, supportedScopes)
 {
     _canBeSuppressedOrUnsuppressed = suppressionFixer.CanBeSuppressedOrUnsuppressed;
 }
Exemplo n.º 5
0
 internal FixAllState(
     FixAllProvider fixAllProvider,
     Project project,
     CodeFixProvider codeFixProvider,
     FixAllScope scope,
     string codeActionEquivalenceKey,
     IEnumerable <string> diagnosticIds,
     FixAllContext.DiagnosticProvider fixAllDiagnosticProvider)
     : this(fixAllProvider, null, project, codeFixProvider, scope, codeActionEquivalenceKey, diagnosticIds, fixAllDiagnosticProvider)
 {
     if (project == null)
     {
         throw new ArgumentNullException(nameof(project));
     }
 }
Exemplo n.º 6
0
        internal static FixAllState Create(
            FixAllProvider fixAllProvider,
            ImmutableDictionary <Project, ImmutableArray <Diagnostic> > diagnosticsToFix,
            CodeFixProvider codeFixProvider,
            string codeActionEquivalenceKey)
        {
            var triggerProject     = diagnosticsToFix.First().Key;
            var diagnosticIds      = GetDiagnosticsIds(diagnosticsToFix.Values);
            var diagnosticProvider = new FixMultipleDiagnosticProvider(diagnosticsToFix);

            return(new FixAllState(
                       fixAllProvider,
                       triggerProject, codeFixProvider,
                       FixAllScope.Custom, codeActionEquivalenceKey,
                       diagnosticIds, diagnosticProvider));
        }