private void ExecuteSyntaxNodeAction <TLanguageKindEnum>( SyntaxNodeAnalyzerAction <TLanguageKindEnum> syntaxNodeAction, SyntaxNode node, SemanticModel semanticModel) where TLanguageKindEnum : struct { var syntaxNodeContext = new SyntaxNodeAnalysisContext(node, semanticModel, _analyzerOptions, _addDiagnostic, _cancellationToken); ExecuteAndCatchIfThrows(syntaxNodeAction.Analyzer, () => syntaxNodeAction.Action(syntaxNodeContext)); }
private void ExecuteSyntaxNodeAction <TLanguageKindEnum>( SyntaxNodeAnalyzerAction <TLanguageKindEnum> syntaxNodeAction, SyntaxNode node, SemanticModel semanticModel, Action <Diagnostic> addDiagnostic, SyntaxNodeAnalyzerStateData analyzerStateOpt) where TLanguageKindEnum : struct { Debug.Assert(analyzerStateOpt == null || analyzerStateOpt.CurrentNode == node); if (ShouldExecuteAction(analyzerStateOpt, syntaxNodeAction)) { var syntaxNodeContext = new SyntaxNodeAnalysisContext(node, semanticModel, _analyzerOptions, addDiagnostic, d => IsSupportedDiagnostic(syntaxNodeAction.Analyzer, d), _cancellationToken); ExecuteAndCatchIfThrows(syntaxNodeAction.Analyzer, () => syntaxNodeAction.Action(syntaxNodeContext)); analyzerStateOpt?.ProcessedActions.Add(syntaxNodeAction); } }