public NullabilityAttributeSymbols GetSymbols(Compilation compilation, CancellationToken cancellationToken = default(CancellationToken)) { Guard.NotNull(compilation, nameof(compilation)); NullabilityAttributeSymbols symbolsSnapshot = symbols.Value; NullabilityAttributeMetadataNames previousNames = symbolsSnapshot?.GetMetadataNames() ?? names.Value ?? LastSeenNames.Value; symbolsSnapshot = previousNames?.GetSymbolsOrNull(compilation); if (symbolsSnapshot == null) { var provider = new SimpleNullabilityAttributeProvider(); symbolsSnapshot = provider.GetSymbols(compilation, cancellationToken); } if (symbolsSnapshot != null) { names.Value = symbolsSnapshot.GetMetadataNames(); LastSeenNames.Value = names.Value; } symbols.Value = symbolsSnapshot; return(symbolsSnapshot); }
public NullabilityAttributeSymbols Scan([NotNull] Compilation compilation, CancellationToken cancellationToken) { Guard.NotNull(compilation, nameof(compilation)); NullabilityAttributeSymbols result = ScanInSources(compilation, cancellationToken); return(result ?? ScanInReferences(compilation, cancellationToken)); }