Esempio n. 1
0
            protected override ImportChain BuildImportChain()
            {
                var previous = Next !.ImportChain;

                if (_declarationSyntax is NamespaceDeclarationSyntax namespaceDecl)
                {
                    // For each dotted name add an empty entry in the chain
                    var name = namespaceDecl.Name;

                    while (name is QualifiedNameSyntax dotted)
                    {
                        previous = new ImportChain(Imports.Empty, previous);
                        name     = dotted.Left;
                    }
                }

                return(new ImportChain(_declaringSymbol.GetImports(_declarationSyntax, basesBeingResolved: null), previous));
            }
Esempio n. 2
0
            private Imports GetImports(ConsList <TypeSymbol>?basesBeingResolved)
            {
                if (_lazyFullImports is null)
                {
                    Interlocked.CompareExchange(ref _lazyFullImports,
                                                _declaringSymbol.DeclaringCompilation.GetPreviousSubmissionImports().Concat(_declaringSymbol.GetImports(_declarationSyntax, basesBeingResolved)),
                                                null);
                }

                return(_lazyFullImports);
            }
Esempio n. 3
0
 protected override Imports GetImports()
 {
     return(_declaringSymbol.GetImports(_declarationSyntax, basesBeingResolved: null));
 }