本文整理汇总了C#中Microsoft.CodeAnalysis.Diagnostics.AbstractHostDiagnosticUpdateSource类的典型用法代码示例。如果您正苦于以下问题:C# AbstractHostDiagnosticUpdateSource类的具体用法?C# AbstractHostDiagnosticUpdateSource怎么用?C# AbstractHostDiagnosticUpdateSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AbstractHostDiagnosticUpdateSource类属于Microsoft.CodeAnalysis.Diagnostics命名空间,在下文中一共展示了AbstractHostDiagnosticUpdateSource类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OutOfProcDiagnosticAnalyzerExecutor
public OutOfProcDiagnosticAnalyzerExecutor(
IDiagnosticAnalyzerService analyzerService,
AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
{
_analyzerService = analyzerService;
_hostDiagnosticUpdateSource = hostDiagnosticUpdateSource;
}
示例2: TestDiagnosticAnalyzerService
internal TestDiagnosticAnalyzerService(
AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource = null,
Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null)
: base(SpecializedCollections.EmptyEnumerable<HostDiagnosticAnalyzerPackage>(), null, hostDiagnosticUpdateSource, new MockDiagnosticUpdateSourceRegistrationService())
{
_onAnalyzerException = onAnalyzerException;
}
示例3: BaseDiagnosticIncrementalAnalyzer
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);
}
示例4: IncrementalAnalyzerDelegatee
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);
}
示例5: TestDiagnosticAnalyzerService
private TestDiagnosticAnalyzerService(
HostAnalyzerManager hostAnalyzerManager,
AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource,
Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException,
IDiagnosticUpdateSourceRegistrationService registrationService = null)
: base(hostAnalyzerManager, hostDiagnosticUpdateSource, registrationService ?? new MockDiagnosticUpdateSourceRegistrationService())
{
_onAnalyzerException = onAnalyzerException;
}
示例6: OnAnalyzerExceptionForSupportedDiagnostics
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);
}
示例7: GetAnalyzerExecutorForSupportedDiagnostics
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);
}
示例8: OutOfProcDiagnosticAnalyzerExecutor
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>>();
}
示例9: HostAnalyzerManager
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);
}
示例10: OnAnalyzerException_NoTelemetryLogging
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);
}
}
示例11: CreateHostAnalyzerManager
private static HostAnalyzerManager CreateHostAnalyzerManager(ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> analyzersMap, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource)
{
var analyzerReferences = ImmutableArray.Create<AnalyzerReference>(new TestAnalyzerReferenceByLanguage(analyzersMap));
return CreateHostAnalyzerManager(analyzerReferences, hostDiagnosticUpdateSource);
}
示例12: HostAnalyzerManager
public HostAnalyzerManager(ImmutableArray<AnalyzerReference> hostAnalyzerReferences, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource) :
this(hostAnalyzerReferences, ImmutableArray<HostDiagnosticAnalyzerPackage>.Empty, hostDiagnosticUpdateSource)
{
}
示例13: HostAnalyzerReferenceDiagnosticReporter
public HostAnalyzerReferenceDiagnosticReporter(AbstractHostDiagnosticUpdateSource hostUpdateSource)
{
_hostUpdateSource = hostUpdateSource;
}
示例14: HostArgsId
public HostArgsId(AbstractHostDiagnosticUpdateSource source, DiagnosticAnalyzer analyzer, ProjectId projectIdOpt) : base(analyzer)
{
_source = source;
_projectIdOpt = projectIdOpt;
}
示例15: HostArgsId
public HostArgsId(AbstractHostDiagnosticUpdateSource source, DiagnosticAnalyzer analyzer, ProjectId id) : base(analyzer)
{
this._source = source;
this._projectId = id;
}