private protected SourcebergBase(GeneratorStartup startup)
        {
            var syntaxActionSetup = new SyntaxAnalyzerSetup();
            var symbolActionSetup = new SymbolAnalyzerGroupSetup();

            startup.ConfigureAnalyzer(new AnalyzerSetupContext(syntaxActionSetup, symbolActionSetup));
            startup.ConfigureServices(_services);
            SyntaxActionGroups = syntaxActionSetup.AnalyzerGroups;
            SymbolActionGroups = symbolActionSetup.AnalyzerGroups;

            foreach (var(actionGroup, _) in SyntaxActionGroups)
            {
                actionGroup.RegisterServices(_services);
            }
            foreach (var(actionGroup, _) in SymbolActionGroups)
            {
                actionGroup.RegisterServices(_services);
            }

            // Add default services
            _services.AddScopedGroup <SourceContextAccessor, IAnalysisLifetime>();
            _services.AddScopedGroup <TypeSymbolProvider, ITypeSymbolProvider, ISourceAddition>();

            _services.AddScopedGroup <AttributeLayoutProvider, IAttributeLayoutProvider>();
            _services.AddScopedGroup <ContextCollectionProvider, IContextCollectionProvider>();
            _services.AddScoped <TypeSymbolLocatorCache>();
        }
Example #2
0
 public SourcebergAnalyzer(GeneratorStartup startup)
     : base(startup)
 {
 }
 internal SourcebergSyntaxReceiver(GeneratorStartup startup) => Startup = startup;