Пример #1
0
        /// <inheritdoc />
        protected override IEnumerable <TagHelperDescriptor> GetTagHelperDescriptors(
            [NotNull] Block documentRoot,
            [NotNull] ParserErrorSink errorSink)
        {
            var visitor = new ViewStartAddRemoveTagHelperVisitor(TagHelperDescriptorResolver,
                                                                 _viewStartDirectiveDescriptors,
                                                                 errorSink);

            return(visitor.GetDescriptors(documentRoot));
        }
Пример #2
0
        /// <inheritdoc />
        protected override IEnumerable <TagHelperDescriptor> GetTagHelperDescriptors(
            [NotNull] Block documentRoot,
            [NotNull] ParserErrorSink errorSink)
        {
            // Grab all the @addtaghelper chunks from view starts and construct TagHelperDirectiveDescriptors
            var directiveDescriptors = _viewStartChunks.OfType <AddTagHelperChunk>()
                                       .Select(chunk => new TagHelperDirectiveDescriptor(
                                                   chunk.LookupText,
                                                   chunk.Start,
                                                   TagHelperDirectiveType.AddTagHelper));

            var visitor = new ViewStartAddRemoveTagHelperVisitor(TagHelperDescriptorResolver,
                                                                 directiveDescriptors,
                                                                 errorSink);
            var descriptors = visitor.GetDescriptors(documentRoot);

            return(descriptors);
        }