Professional Documents
Culture Documents
Detector
Detector
// Licensed under the Apache License, Version 2.0. See License.txt in the project
root for license information.
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Operations;
namespace Microsoft.AspNetCore.Analyzers
{
internal static class CompilationFeatureDetector
{
public static async Task<IImmutableSet<string>> DetectFeaturesAsync(
Compilation compilation,
CancellationToken cancellationToken = default)
{
var symbols = new StartupSymbols(compilation);
if (!symbols.HasRequiredSymbols)
{
// Cannot find ASP.NET Core types.
return ImmutableHashSet<string>.Empty;
}
return features.ToImmutable();
}
}
}