예제 #1
0
 public static AnalyzerActions Compose(AnalyzerActions a, AnalyzerActions b) =>
 new AnalyzerActions
 {
     CodeBlockAction           = ComposeAction(a.CodeBlockAction, b.CodeBlockAction),
     CodeBlockStartAction      = ComposeAction(a.CodeBlockStartAction, b.CodeBlockStartAction),
     CompilationAction         = ComposeAction(a.CompilationAction, b.CompilationAction),
     CompilationStartAction    = ComposeAction(a.CompilationStartAction, b.CompilationStartAction),
     OperationAction           = ComposeAction(a.OperationAction, b.OperationAction),
     OperationBlockAction      = ComposeAction(a.OperationBlockAction, b.OperationBlockAction),
     OperationBlockStartAction = ComposeAction(a.OperationBlockStartAction, b.OperationBlockStartAction),
     SemanticModelAction       = ComposeAction(a.SemanticModelAction, b.SemanticModelAction),
     SymbolAction      = ComposeAction(a.SymbolAction, b.SymbolAction),
     SymbolStartAction = ComposeAction(a.SymbolStartAction, b.SymbolStartAction),
     SyntaxNodeAction  = ComposeAction(a.SyntaxNodeAction, b.SyntaxNodeAction),
     SyntaxTreeAction  = ComposeAction(a.SyntaxTreeAction, b.SyntaxTreeAction)
 };
예제 #2
0
 /// <summary>
 /// Instantiate a stub for <see cref="DiagnosticAnalyzer" /> with the specified actions.
 /// All actions in <paramref name="actions" /> will be registered at <see cref="Initialize" />.
 /// </summary>
 public StubAnalyzer(AnalyzerActions actions) => _actions = actions;