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)); }
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); }
protected override Imports GetImports() { return(_declaringSymbol.GetImports(_declarationSyntax, basesBeingResolved: null)); }