private static IReadOnlyList <TagHelperDescriptor> GetTagHelpersFromCompilation(Compilation compilation, StaticCompilationTagHelperFeature tagHelperFeature, SyntaxTree syntaxTrees) { var compilationWithDeclarations = compilation.AddSyntaxTrees(syntaxTrees); tagHelperFeature.Compilation = compilationWithDeclarations; tagHelperFeature.TargetAssembly = compilationWithDeclarations.Assembly; return(tagHelperFeature.GetDescriptors()); }
private IReadOnlyList <TagHelperDescriptor> GetTagHelpers(IEnumerable <MetadataReference> references, StaticCompilationTagHelperFeature tagHelperFeature, Compilation compilation) { List <TagHelperDescriptor> descriptors = new(); tagHelperFeature.Compilation = compilation; foreach (var reference in references) { if (compilation.GetAssemblyOrModuleSymbol(reference) is IAssemblySymbol assembly) { tagHelperFeature.TargetAssembly = assembly; descriptors.AddRange(tagHelperFeature.GetDescriptors()); } } return(descriptors); }