21 references to RegisterForSyntaxNotifications
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (20)
SourceGeneration\SyntaxAwareGeneratorTests.cs (20)
40onInit: (i) => i.RegisterForSyntaxNotifications(() => new TestSyntaxReceiver()), 143onInit: (i) => i.RegisterForSyntaxNotifications(() => new TestSyntaxReceiver()), 186init.RegisterForSyntaxNotifications(() => new TestSyntaxReceiver()); 189init.RegisterForSyntaxNotifications(() => new TestSyntaxReceiver()); 205init.RegisterForSyntaxNotifications(() => new TestSyntaxReceiver()); 210init.RegisterForSyntaxNotifications(() => new TestSyntaxReceiver()); 241onInit: (i) => i.RegisterForSyntaxNotifications(() => new TestSyntaxReceiver()), 322onInit: (i) => i.RegisterForSyntaxNotifications(() => new TestSyntaxReceiver(++invocations)), 376onInit: (i) => i.RegisterForSyntaxNotifications((SyntaxReceiverCreator)(() => throw exception)), 420onInit: (i) => i.RegisterForSyntaxNotifications(() => new TestSyntaxReceiver(tag: 0, callback: (a) => { if (a is AssignmentExpressionSyntax) throw exception; })), 464onInit: (i) => i.RegisterForSyntaxNotifications(() => receiver1), 470onInit: (i) => i.RegisterForSyntaxNotifications(() => receiver2), 506onInit: (i) => i.RegisterForSyntaxNotifications(() => new TestSyntaxReceiver(tag: 0, callback: (a) => { if (a is AssignmentExpressionSyntax) throw exception; })), 512onInit: (i) => i.RegisterForSyntaxNotifications(() => new TestSyntaxReceiver(tag: 1)), 563onInit: (i) => { i.RegisterForSyntaxNotifications(() => receiver = new TestSyntaxReceiver()); throw exception; }, 596onInit: (i) => i.RegisterForSyntaxNotifications((SyntaxReceiverCreator)(() => null!)), 635i.RegisterForSyntaxNotifications(() => receiver = new TestSyntaxReceiver()); 691i.RegisterForSyntaxNotifications(() => new TestSyntaxReceiver()); 746onInit: (i) => i.RegisterForSyntaxNotifications(() => new TestSyntaxReceiver()), 2062onInit: (i) => i.RegisterForSyntaxNotifications(() => new TestSyntaxReceiver(tag: 0, callback: (a) => { if (a is AssignmentExpressionSyntax) { throw new OperationCanceledException("Simulated cancellation from external source"); } })),
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
SourceGeneration\GeneratorDriverTests.vb (1)
435context.RegisterForSyntaxNotifications(Function() _receiver)