本文整理汇总了C#中Microsoft.CodeAnalysis.Diagnostics.AnalysisState.?.MarkSymbolComplete方法的典型用法代码示例。如果您正苦于以下问题:C# AnalysisState.?.MarkSymbolComplete方法的具体用法?C# AnalysisState.?.MarkSymbolComplete怎么用?C# AnalysisState.?.MarkSymbolComplete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.CodeAnalysis.Diagnostics.AnalysisState
的用法示例。
在下文中一共展示了AnalysisState.?.MarkSymbolComplete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExecuteSymbolActions
private void ExecuteSymbolActions(SymbolDeclaredCompilationEvent symbolEvent, AnalysisScope analysisScope, AnalysisState analysisStateOpt, CancellationToken cancellationToken)
{
var symbol = symbolEvent.Symbol;
if (!analysisScope.ShouldAnalyze(symbol))
{
return;
}
Action<Diagnostic> addDiagnosticForSymbol = GetDiagnosticSinkWithSuppression(DiagnosticQueue.Enqueue, symbolEvent.Compilation, symbol);
Action<Diagnostic, DiagnosticAnalyzer, bool> addLocalDiagnosticForSymbol = analysisScope.CategorizeDiagnostics ? GetDiagnosticSinkWithSuppression(DiagnosticQueue.EnqueueLocal, symbolEvent.Compilation, symbol) : null;
Action<Diagnostic, DiagnosticAnalyzer> addNonLocalDiagnosticForSymbol = analysisScope.CategorizeDiagnostics ? GetDiagnosticSinkWithSuppression(DiagnosticQueue.EnqueueNonLocal, symbolEvent.Compilation, symbol) : null;
foreach (var analyzer in analysisScope.Analyzers)
{
// Invoke symbol analyzers only for source symbols.
ImmutableArray<ImmutableArray<SymbolAnalyzerAction>> actionsByKind;
if (_symbolActionsByKind.TryGetValue(analyzer, out actionsByKind) && (int)symbol.Kind < actionsByKind.Length)
{
analyzerExecutor.ExecuteSymbolActions(actionsByKind[(int)symbol.Kind], analyzer, symbol, addDiagnosticForSymbol,
addLocalDiagnosticForSymbol, addNonLocalDiagnosticForSymbol, GetTopmostNodeForAnalysis, analysisScope, analysisStateOpt);
}
else
{
analysisStateOpt?.MarkSymbolComplete(symbol, analyzer);
}
}
}
示例2: ExecuteSymbolActions
private void ExecuteSymbolActions(SymbolDeclaredCompilationEvent symbolEvent, AnalysisScope analysisScope, AnalysisState analysisStateOpt, CancellationToken cancellationToken)
{
var symbol = symbolEvent.Symbol;
if (!analysisScope.ShouldAnalyze(symbol))
{
return;
}
foreach (var analyzer in analysisScope.Analyzers)
{
// Invoke symbol analyzers only for source symbols.
ImmutableArray<ImmutableArray<SymbolAnalyzerAction>> actionsByKind;
if (_symbolActionsByKind.TryGetValue(analyzer, out actionsByKind) && (int)symbol.Kind < actionsByKind.Length)
{
analyzerExecutor.ExecuteSymbolActions(actionsByKind[(int)symbol.Kind], analyzer, symbol, GetTopmostNodeForAnalysis, analysisScope, analysisStateOpt);
}
else
{
analysisStateOpt?.MarkSymbolComplete(symbol, analyzer);
}
}
}