コード例 #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
ファイル: IncrementalContexts.cs プロジェクト: lameox/roslyn
 internal IncrementalGeneratorInitializationContext(
     ArrayBuilder <SyntaxInputNode> syntaxInputBuilder,
     ArrayBuilder <IIncrementalGeneratorOutputNode> outputNodes,
     ISyntaxHelper syntaxHelper,
     string sourceExtension)
 {
     _syntaxInputBuilder = syntaxInputBuilder;
     _outputNodes        = outputNodes;
     SyntaxHelper        = syntaxHelper;
     _sourceExtension    = sourceExtension;
 }
コード例 #5
0
ファイル: SyntaxTree.cs プロジェクト: lameox/roslyn
        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)
 {
 }
コード例 #9
0
 internal AddPackageAnalyzer(IPackageSearcher packageSearcher, ISyntaxHelper syntaxHelper)
 {
     _packageSearcher = packageSearcher;
     _syntaxHelper = syntaxHelper;
 }
コード例 #10
0
 public AddPackageAnalyzer(ILog logger, ISyntaxHelper syntaxHelper)
     : this(new PackageSearcher(logger), syntaxHelper)
 {
 }
コード例 #11
0
 public AddPackageAnalyzer(ISyntaxHelper syntaxHelper)
     : this(new PackageSearcher(new LogFactory(LogLevel.Quiet)), syntaxHelper)
 {
 }