Пример #1
0
 public SyntaxReceiverStrategy(
     SyntaxContextReceiverCreator receiverCreator,
     Action <IIncrementalGeneratorOutputNode> registerOutput,
     ISyntaxHelper syntaxHelper)
 {
     _receiverCreator = receiverCreator;
     _registerOutput  = registerOutput;
     _syntaxHelper    = syntaxHelper;
 }
Пример #2
0
 internal PredicateSyntaxStrategy(
     Func <SyntaxNode, CancellationToken, bool> filterFunc,
     Func <GeneratorSyntaxContext, CancellationToken, T> transformFunc,
     ISyntaxHelper syntaxHelper)
 {
     _transformFunc = transformFunc;
     _syntaxHelper  = syntaxHelper;
     _filterFunc    = filterFunc;
 }
Пример #3
0
 internal SyntaxValueProvider(
     IncrementalGeneratorInitializationContext context,
     ArrayBuilder <SyntaxInputNode> inputNodes,
     Action <IIncrementalGeneratorOutputNode> registerOutput,
     ISyntaxHelper syntaxHelper)
 {
     _context        = context;
     _inputNodes     = inputNodes;
     _registerOutput = registerOutput;
     _syntaxHelper   = syntaxHelper;
 }
Пример #4
0
 internal IncrementalGeneratorInitializationContext(
     ArrayBuilder <SyntaxInputNode> syntaxInputBuilder,
     ArrayBuilder <IIncrementalGeneratorOutputNode> outputNodes,
     ISyntaxHelper syntaxHelper,
     string sourceExtension)
 {
     _syntaxInputBuilder = syntaxInputBuilder;
     _outputNodes        = outputNodes;
     SyntaxHelper        = syntaxHelper;
     _sourceExtension    = sourceExtension;
 }
Пример #5
0
        internal SourceGeneratorSyntaxTreeInfo GetSourceGeneratorInfo(
            ISyntaxHelper syntaxHelper, CancellationToken cancellationToken)
        {
            if (_sourceGeneratorInfo is SourceGeneratorSyntaxTreeInfo.NotComputedYet)
            {
                var root = this.GetRoot(cancellationToken);

                var result = SourceGeneratorSyntaxTreeInfo.None;

                if (syntaxHelper.ContainsGlobalAliases(root))
                {
                    result |= SourceGeneratorSyntaxTreeInfo.ContainsGlobalAliases;
                }

                if (syntaxHelper.ContainsAttributeList(root))
                {
                    result |= SourceGeneratorSyntaxTreeInfo.ContainsAttributeList;
                }

                _sourceGeneratorInfo = result;
            }

            return(_sourceGeneratorInfo);
        }
Пример #6
0
 internal AddPackageAnalyzer(IPackageSearcher packageSearcher, ISyntaxHelper syntaxHelper)
 {
     _packageSearcher = packageSearcher;
     _syntaxHelper    = syntaxHelper;
 }
Пример #7
0
 public AddPackageAnalyzer(ILog logger, ISyntaxHelper syntaxHelper)
     : this(new PackageSearcher(logger), syntaxHelper)
 {
 }
Пример #8
0
 public AddPackageAnalyzer(ISyntaxHelper syntaxHelper)
     : this(new PackageSearcher(new LogFactory(LogLevel.Quiet)), syntaxHelper)
 {
 }
 internal AddPackageAnalyzer(IPackageSearcher packageSearcher, ISyntaxHelper syntaxHelper)
 {
     _packageSearcher = packageSearcher;
     _syntaxHelper = syntaxHelper;
 }
 public AddPackageAnalyzer(ILog logger, ISyntaxHelper syntaxHelper)
     : this(new PackageSearcher(logger), syntaxHelper)
 {
 }
 public AddPackageAnalyzer(ISyntaxHelper syntaxHelper)
     : this(new PackageSearcher(new LogFactory(LogLevel.Quiet)), syntaxHelper)
 {
 }