internal TestDiagnosticAnalyzerService(
     ImmutableArray<AnalyzerReference> hostAnalyzerReferences,
     AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource = null,
     Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null)
     : this(CreateHostAnalyzerManager(hostAnalyzerReferences, hostDiagnosticUpdateSource), hostDiagnosticUpdateSource, onAnalyzerException)
 {
 }
 internal TestDiagnosticAnalyzerService(
     AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource = null,
     Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null)
    : base(SpecializedCollections.EmptyEnumerable<HostDiagnosticAnalyzerPackage>(), null, hostDiagnosticUpdateSource, new MockDiagnosticUpdateSourceRegistrationService())
 {
     _onAnalyzerException = onAnalyzerException;
 }
 public OutOfProcDiagnosticAnalyzerExecutor(
     IDiagnosticAnalyzerService analyzerService,
     AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
 {
     _analyzerService = analyzerService;
     _hostDiagnosticUpdateSource = hostDiagnosticUpdateSource;
 }
 internal TestDiagnosticAnalyzerService(
     ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> analyzersMap,
     AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource = null,
     Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null,
     IDiagnosticUpdateSourceRegistrationService registrationService = null)
     : this(CreateHostAnalyzerManager(analyzersMap, hostDiagnosticUpdateSource), hostDiagnosticUpdateSource, onAnalyzerException, registrationService)
 {
 }
 protected BaseDiagnosticIncrementalAnalyzer(DiagnosticAnalyzerService owner, Workspace workspace, HostAnalyzerManager hostAnalyzerManager, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
 {
     this.Owner = owner;
     this.Workspace = workspace;
     this.HostAnalyzerManager = hostAnalyzerManager;
     this.HostDiagnosticUpdateSource = hostDiagnosticUpdateSource;
     this.DiagnosticLogAggregator = new DiagnosticLogAggregator(owner);
 }
 internal TestDiagnosticAnalyzerService(
     string language,
     ImmutableArray<DiagnosticAnalyzer> analyzers,
     AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource = null,
     Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null)
     : this(CreateHostAnalyzerManager(language, analyzers, hostDiagnosticUpdateSource), hostDiagnosticUpdateSource, onAnalyzerException)
 {
 }
 private TestDiagnosticAnalyzerService(
     HostAnalyzerManager hostAnalyzerManager,
     AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource,
     Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException,
     IDiagnosticUpdateSourceRegistrationService registrationService = null)
     : base(hostAnalyzerManager, hostDiagnosticUpdateSource, registrationService ?? new MockDiagnosticUpdateSourceRegistrationService())
 {
     _onAnalyzerException = onAnalyzerException;
 }
            public IncrementalAnalyzerDelegatee(DiagnosticAnalyzerService owner, Workspace workspace, HostAnalyzerManager hostAnalyzerManager, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
                : base(owner, workspace, hostAnalyzerManager, hostDiagnosticUpdateSource)
            {
                var v1CorrelationId = LogAggregator.GetNextId();
                _engineV1 = new EngineV1.DiagnosticIncrementalAnalyzer(owner, v1CorrelationId, workspace, hostAnalyzerManager, hostDiagnosticUpdateSource);

                var v2CorrelationId = LogAggregator.GetNextId();
                _engineV2 = new EngineV2.DiagnosticIncrementalAnalyzer(owner, v2CorrelationId, workspace, hostAnalyzerManager, hostDiagnosticUpdateSource);
            }
 private TestDiagnosticAnalyzerService(
     HostAnalyzerManager hostAnalyzerManager,
     AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource,
     Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException,
     IDiagnosticUpdateSourceRegistrationService registrationService = null)
     : base(hostAnalyzerManager, hostDiagnosticUpdateSource, registrationService ?? new MockDiagnosticUpdateSourceRegistrationService())
 {
     _hostAnalyzerReferenceMap = hostAnalyzerManager.CreateAnalyzerReferencesMap(projectOpt: null);
     _onAnalyzerException = onAnalyzerException;
 }
예제 #10
0
        internal static void OnAnalyzerExceptionForSupportedDiagnostics(DiagnosticAnalyzer analyzer, Exception exception, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
        {
            if (exception is OperationCanceledException)
            {
                return;
            }

            var diagnostic = CreateAnalyzerExceptionDiagnostic(analyzer, exception);
            OnAnalyzerException_NoTelemetryLogging(exception, analyzer, diagnostic, hostDiagnosticUpdateSource, projectIdOpt: null);
        }
        public OutOfProcDiagnosticAnalyzerExecutor(
            IDiagnosticAnalyzerService analyzerService,
            AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
        {
            _analyzerService = analyzerService;
            _hostDiagnosticUpdateSource = hostDiagnosticUpdateSource;

            // currently option is a bit wierd since it is not part of snapshot and 
            // we can't load all options without loading all language specific dlls.
            // we have tracking issue for this.
            // https://github.com/dotnet/roslyn/issues/13643
            _lastOptionSetPerLanguage = new ConcurrentDictionary<string, ValueTuple<OptionSet, Asset>>();
        }
예제 #12
0
        internal static AnalyzerExecutor GetAnalyzerExecutorForSupportedDiagnostics(
            DiagnosticAnalyzer analyzer,
            AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource,
            Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            // Skip telemetry logging if the exception is thrown as we are computing supported diagnostics and
            // we can't determine if any descriptors support getting telemetry without having the descriptors.
            Action<Exception, DiagnosticAnalyzer, Diagnostic> defaultOnAnalyzerException = (ex, a, diagnostic) =>
                OnAnalyzerException_NoTelemetryLogging(ex, a, diagnostic, hostDiagnosticUpdateSource);

            return AnalyzerExecutor.CreateForSupportedDiagnostics(onAnalyzerException ?? defaultOnAnalyzerException, AnalyzerManager.Instance, cancellationToken: cancellationToken);
        }
예제 #13
0
        private HostAnalyzerManager(
            ImmutableArray<AnalyzerReference> hostAnalyzerReferences, ImmutableArray<HostDiagnosticAnalyzerPackage> hostAnalyzerPackages, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
        {
            _hostDiagnosticAnalyzerPackages = hostAnalyzerPackages;
            _hostDiagnosticUpdateSource = hostDiagnosticUpdateSource;

            _hostAnalyzerReferencesMap = hostAnalyzerReferences.IsDefault ? ImmutableDictionary<string, AnalyzerReference>.Empty : CreateAnalyzerReferencesMap(hostAnalyzerReferences);
            _hostDiagnosticAnalyzersPerLanguageMap = new ConcurrentDictionary<string, ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>>>(concurrencyLevel: 2, capacity: 2);
            _lazyHostDiagnosticAnalyzersPerReferenceMap = new Lazy<ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>>>(() => CreateDiagnosticAnalyzersPerReferenceMap(_hostAnalyzerReferencesMap), isThreadSafe: true);

            _compilerDiagnosticAnalyzerMap = ImmutableDictionary<string, DiagnosticAnalyzer>.Empty;
            _compilerDiagnosticAnalyzerDescriptorMap = ImmutableDictionary<DiagnosticAnalyzer, HashSet<string>>.Empty;
            _hostDiagnosticAnalzyerPackageNameMap = ImmutableDictionary<DiagnosticAnalyzer, string>.Empty;

            DiagnosticAnalyzerLogger.LogWorkspaceAnalyzers(hostAnalyzerReferences);
        }
예제 #14
0
        internal static void OnAnalyzerException_NoTelemetryLogging(
            Exception ex,
            DiagnosticAnalyzer analyzer,
            Diagnostic diagnostic,
            AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource,
            ProjectId projectIdOpt)
        {
            if (diagnostic != null)
            {
                hostDiagnosticUpdateSource?.ReportAnalyzerDiagnostic(analyzer, diagnostic, hostDiagnosticUpdateSource?.Workspace, projectIdOpt);
            }

            if (IsBuiltInAnalyzer(analyzer))
            {
                FatalError.ReportWithoutCrashUnlessCanceled(ex);
            }
        }
예제 #15
0
 public HostAnalyzerReferenceDiagnosticReporter(AbstractHostDiagnosticUpdateSource hostUpdateSource)
 {
     _hostUpdateSource = hostUpdateSource;
 }
예제 #16
0
 // protected for testing purposes.
 protected DiagnosticAnalyzerService(ImmutableArray <AnalyzerReference> workspaceAnalyzers, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource = null) : this()
 {
     _hostAnalyzerManager        = new HostAnalyzerManager(workspaceAnalyzers, hostDiagnosticUpdateSource);
     _hostDiagnosticUpdateSource = hostDiagnosticUpdateSource;
 }
 internal TestDiagnosticAnalyzerService(ImmutableArray<AnalyzerReference> workspaceAnalyzers, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource = null, Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null)
     : base(workspaceAnalyzers, hostDiagnosticUpdateSource)
 {
     _onAnalyzerException = onAnalyzerException;
 }
 internal TestDiagnosticAnalyzerService(string language, ImmutableArray<DiagnosticAnalyzer> analyzers, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource = null, Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null)
     : this(ImmutableDictionary.CreateRange(
         SpecializedCollections.SingletonEnumerable(KeyValuePair.Create(language, analyzers))), hostDiagnosticUpdateSource, onAnalyzerException)
 {
 }
예제 #19
0
 public HostAnalyzerManager(ImmutableArray <AnalyzerReference> hostAnalyzerReferences, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource) :
     this(hostAnalyzerReferences, ImmutableArray <HostDiagnosticAnalyzerPackage> .Empty, hostDiagnosticUpdateSource)
 {
 }
 private static HostAnalyzerManager CreateHostAnalyzerManager(string language, DiagnosticAnalyzer analyzer, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
 {
     return CreateHostAnalyzerManager(language, ImmutableArray.Create(analyzer), hostDiagnosticUpdateSource);
 }
예제 #21
0
 private static HostAnalyzerManager CreateHostAnalyzerManager(string language, DiagnosticAnalyzer analyzer, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
 {
     return(CreateHostAnalyzerManager(language, ImmutableArray.Create(analyzer), hostDiagnosticUpdateSource));
 }
예제 #22
0
        private HostAnalyzerManager(
            Lazy <ImmutableArray <AnalyzerReference> > hostAnalyzerReferences, Lazy <ImmutableArray <HostDiagnosticAnalyzerPackage> > hostAnalyzerPackages, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
        {
            _hostDiagnosticAnalyzerPackages = hostAnalyzerPackages;
            _hostDiagnosticUpdateSource     = hostDiagnosticUpdateSource;

            _hostAnalyzerReferencesMap                  = new Lazy <ImmutableDictionary <object, AnalyzerReference> >(() => hostAnalyzerReferences.Value.IsDefaultOrEmpty ? ImmutableDictionary <object, AnalyzerReference> .Empty : CreateAnalyzerReferencesMap(hostAnalyzerReferences.Value), isThreadSafe: true);
            _hostDiagnosticAnalyzersPerLanguageMap      = new ConcurrentDictionary <string, ImmutableDictionary <object, ImmutableArray <DiagnosticAnalyzer> > >(concurrencyLevel: 2, capacity: 2);
            _lazyHostDiagnosticAnalyzersPerReferenceMap = new Lazy <ImmutableDictionary <object, ImmutableArray <DiagnosticAnalyzer> > >(() => CreateDiagnosticAnalyzersPerReferenceMap(_hostAnalyzerReferencesMap.Value), isThreadSafe: true);

            _compilerDiagnosticAnalyzerMap           = ImmutableDictionary <string, DiagnosticAnalyzer> .Empty;
            _compilerDiagnosticAnalyzerDescriptorMap = ImmutableDictionary <DiagnosticAnalyzer, HashSet <string> > .Empty;
            _hostDiagnosticAnalyzerPackageNameMap    = ImmutableDictionary <DiagnosticAnalyzer, string> .Empty;
            _descriptorCache = new ConditionalWeakTable <DiagnosticAnalyzer, IReadOnlyCollection <DiagnosticDescriptor> >();
        }
예제 #23
0
 public HostAnalyzerManager(Lazy <ImmutableArray <HostDiagnosticAnalyzerPackage> > hostAnalyzerPackages, IAnalyzerAssemblyLoader hostAnalyzerAssemblyLoader, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource, PrimaryWorkspace primaryWorkspace)
     : this(new Lazy <ImmutableArray <AnalyzerReference> >(() => CreateAnalyzerReferencesFromPackages(hostAnalyzerPackages.Value, new HostAnalyzerReferenceDiagnosticReporter(hostDiagnosticUpdateSource, primaryWorkspace), hostAnalyzerAssemblyLoader), isThreadSafe : true),
            hostAnalyzerPackages, hostDiagnosticUpdateSource)
 {
 }
예제 #24
0
 public HostAnalyzerReferenceDiagnosticReporter(AbstractHostDiagnosticUpdateSource hostUpdateSource, PrimaryWorkspace primaryWorkspace)
 {
     _hostUpdateSource = hostUpdateSource;
     _primaryWorkspace = primaryWorkspace;
 }
예제 #25
0
 // this is for testing
 internal HostAnalyzerManager(ImmutableArray <AnalyzerReference> hostAnalyzerReferences, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
     : this(new Lazy <ImmutableArray <AnalyzerReference> >(() => hostAnalyzerReferences), new Lazy <ImmutableArray <HostDiagnosticAnalyzerPackage> >(() => ImmutableArray <HostDiagnosticAnalyzerPackage> .Empty), hostDiagnosticUpdateSource)
 {
 }
예제 #26
0
 protected BaseDiagnosticIncrementalAnalyzer(DiagnosticAnalyzerService owner, Workspace workspace, HostAnalyzerManager hostAnalyzerManager, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
 {
     this.Owner                      = owner;
     this.Workspace                  = workspace;
     this.HostAnalyzerManager        = hostAnalyzerManager;
     this.HostDiagnosticUpdateSource = hostDiagnosticUpdateSource;
     this.DiagnosticLogAggregator    = new DiagnosticLogAggregator(owner);
 }
            public IncrementalAnalyzerDelegatee(DiagnosticAnalyzerService owner, Workspace workspace, HostAnalyzerManager hostAnalyzerManager, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
                : base(owner, workspace, hostAnalyzerManager, hostDiagnosticUpdateSource)
            {
                var v1CorrelationId = LogAggregator.GetNextId();

                _engineV1 = new EngineV1.DiagnosticIncrementalAnalyzer(owner, v1CorrelationId, workspace, hostAnalyzerManager, hostDiagnosticUpdateSource);

                var v2CorrelationId = LogAggregator.GetNextId();

                _engineV2 = new EngineV2.DiagnosticIncrementalAnalyzer(owner, v2CorrelationId, workspace, hostAnalyzerManager, hostDiagnosticUpdateSource);
            }
예제 #28
0
 public HostAnalyzerManager(ImmutableArray<AnalyzerReference> hostAnalyzerReferences, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource) :
     this(hostAnalyzerReferences, ImmutableArray<HostDiagnosticAnalyzerPackage>.Empty, hostDiagnosticUpdateSource)
 {
 }
예제 #29
0
 public HostAnalyzerReferenceDiagnosticReporter(AbstractHostDiagnosticUpdateSource hostUpdateSource)
 {
     _hostUpdateSource = hostUpdateSource;
 }
예제 #30
0
        private HostAnalyzerManager(
            ImmutableArray <AnalyzerReference> hostAnalyzerReferences, ImmutableArray <HostDiagnosticAnalyzerPackage> hostAnalyzerPackages, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
        {
            _hostDiagnosticAnalyzerPackages = hostAnalyzerPackages;
            _hostDiagnosticUpdateSource     = hostDiagnosticUpdateSource;

            _hostAnalyzerReferencesMap                  = hostAnalyzerReferences.IsDefault ? ImmutableDictionary <string, AnalyzerReference> .Empty : CreateAnalyzerReferencesMap(hostAnalyzerReferences);
            _hostDiagnosticAnalyzersPerLanguageMap      = new ConcurrentDictionary <string, ImmutableDictionary <string, ImmutableArray <DiagnosticAnalyzer> > >(concurrencyLevel: 2, capacity: 2);
            _lazyHostDiagnosticAnalyzersPerReferenceMap = new Lazy <ImmutableDictionary <string, ImmutableArray <DiagnosticAnalyzer> > >(() => CreateDiagnosticAnalyzersPerReferenceMap(_hostAnalyzerReferencesMap), isThreadSafe: true);

            _compilerDiagnosticAnalyzerMap           = ImmutableDictionary <string, DiagnosticAnalyzer> .Empty;
            _compilerDiagnosticAnalyzerDescriptorMap = ImmutableDictionary <DiagnosticAnalyzer, HashSet <string> > .Empty;
            _hostDiagnosticAnalzyerPackageNameMap    = ImmutableDictionary <DiagnosticAnalyzer, string> .Empty;

            DiagnosticAnalyzerLogger.LogWorkspaceAnalyzers(hostAnalyzerReferences);
        }
 private TestDiagnosticAnalyzerService(HostAnalyzerManager hostAnalyzerManager, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource, Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException)
     : base(hostAnalyzerManager, hostDiagnosticUpdateSource)
 {
     _onAnalyzerException = onAnalyzerException;
 }
 private static HostAnalyzerManager CreateHostAnalyzerManager(ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> analyzersMap, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
 {
     var analyzerReferences = ImmutableArray.Create<AnalyzerReference>(new TestAnalyzerReferenceByLanguage(analyzersMap));
     return CreateHostAnalyzerManager(analyzerReferences, hostDiagnosticUpdateSource);
 }
 private static HostAnalyzerManager CreateHostAnalyzerManager(string language, ImmutableArray<DiagnosticAnalyzer> analyzers, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
 {
     var map = ImmutableDictionary.CreateRange(
         SpecializedCollections.SingletonEnumerable(KeyValuePair.Create(language, analyzers)));
     return CreateHostAnalyzerManager(map, hostDiagnosticUpdateSource);
 }
예제 #34
0
 public HostAnalyzerManager(IEnumerable <HostDiagnosticAnalyzerPackage> hostAnalyzerPackages, IAnalyzerAssemblyLoader hostAnalyzerAssemblyLoader, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource) :
     this(CreateAnalyzerReferencesFromPackages(hostAnalyzerPackages, new HostAnalyzerReferenceDiagnosticReporter(hostDiagnosticUpdateSource), hostAnalyzerAssemblyLoader),
          hostAnalyzerPackages.ToImmutableArrayOrEmpty(), hostDiagnosticUpdateSource)
 {
 }
 private static HostAnalyzerManager CreateHostAnalyzerManager(ImmutableArray<AnalyzerReference> hostAnalyzerReferences, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
 {
     return new HostAnalyzerManager(hostAnalyzerReferences, hostDiagnosticUpdateSource);
 }
예제 #36
0
 public HostAnalyzerManager(IEnumerable <HostDiagnosticAnalyzerPackage> hostAnalyzerPackages, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource) :
     this(CreateAnalyzerReferencesFromPackages(hostAnalyzerPackages), hostAnalyzerPackages.ToImmutableArrayOrEmpty(), hostDiagnosticUpdateSource)
 {
 }
 internal TestDiagnosticAnalyzerService(string language, DiagnosticAnalyzer analyzer, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource = null, Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null)
     : this(language, ImmutableArray.Create(analyzer), hostDiagnosticUpdateSource, onAnalyzerException)
 {
 }
예제 #38
0
 // protected for testing purposes.
 protected DiagnosticAnalyzerService(IEnumerable <HostDiagnosticAnalyzerPackage> workspaceAnalyzerPackages, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource) : this()
 {
     _hostAnalyzerManager        = new HostAnalyzerManager(workspaceAnalyzerPackages, hostDiagnosticUpdateSource);
     _hostDiagnosticUpdateSource = hostDiagnosticUpdateSource;
 }
 internal TestDiagnosticAnalyzerService(ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> analyzersMap, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource = null, Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null)
     : base(ImmutableArray.Create<AnalyzerReference>(new TestAnalyzerReferenceByLanguage(analyzersMap)), hostDiagnosticUpdateSource)
 {
     _onAnalyzerException = onAnalyzerException;
 }
예제 #40
0
        internal static void OnAnalyzerExceptionForSupportedDiagnostics(DiagnosticAnalyzer analyzer, Exception exception, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
        {
            if (exception is OperationCanceledException)
            {
                return;
            }

            var diagnostic = CreateAnalyzerExceptionDiagnostic(analyzer, exception);

            OnAnalyzerException_NoTelemetryLogging(exception, analyzer, diagnostic, hostDiagnosticUpdateSource, projectIdOpt: null);
        }
예제 #41
0
 public HostArgsId(AbstractHostDiagnosticUpdateSource source, DiagnosticAnalyzer analyzer, ProjectId projectIdOpt) : base(analyzer)
 {
     _source       = source;
     _projectIdOpt = projectIdOpt;
 }
예제 #42
0
 private static HostAnalyzerManager CreateHostAnalyzerManager(ImmutableArray <AnalyzerReference> hostAnalyzerReferences, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
 {
     return(new HostAnalyzerManager(hostAnalyzerReferences, hostDiagnosticUpdateSource));
 }
 public HostArgsId(AbstractHostDiagnosticUpdateSource source, DiagnosticAnalyzer analyzer, ProjectId projectIdOpt) : base(analyzer)
 {
     _source = source;
     _projectIdOpt = projectIdOpt;
 }
예제 #44
0
        private static HostAnalyzerManager CreateHostAnalyzerManager(ImmutableDictionary <string, ImmutableArray <DiagnosticAnalyzer> > analyzersMap, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
        {
            var analyzerReferences = ImmutableArray.Create <AnalyzerReference>(new TestAnalyzerReferenceByLanguage(analyzersMap));

            return(CreateHostAnalyzerManager(analyzerReferences, hostDiagnosticUpdateSource));
        }
예제 #45
0
 public HostAnalyzerManager(IEnumerable<HostDiagnosticAnalyzerPackage> hostAnalyzerPackages, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource) :
     this(CreateAnalyzerReferencesFromPackages(hostAnalyzerPackages, new HostAnalyzerReferenceDiagnosticReporter(hostDiagnosticUpdateSource)),
          hostAnalyzerPackages.ToImmutableArrayOrEmpty(), hostDiagnosticUpdateSource)
 {
 }
예제 #46
0
        private static HostAnalyzerManager CreateHostAnalyzerManager(string language, ImmutableArray <DiagnosticAnalyzer> analyzers, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
        {
            var map = ImmutableDictionary.CreateRange(
                SpecializedCollections.SingletonEnumerable(KeyValuePairUtil.Create(language, analyzers)));

            return(CreateHostAnalyzerManager(map, hostDiagnosticUpdateSource));
        }
예제 #47
0
 protected BaseDiagnosticIncrementalAnalyzer(Workspace workspace, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
 {
     this.Workspace = workspace;
     this.HostDiagnosticUpdateSource = hostDiagnosticUpdateSource;
 }
 public HostArgsId(AbstractHostDiagnosticUpdateSource source, DiagnosticAnalyzer analyzer, ProjectId id) : base(analyzer)
 {
     this._source = source;
     this._projectId = id;
 }