예제 #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));
        }
예제 #2
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));
     }
 }