<commit_before>import { IHTMLTagProvider } from './common';
import * as tags from 'element-helper-json/element-tags.json';
import * as attributes from 'element-helper-json/element-attributes.json';

export function getElementTagProvider(): IHTMLTagProvider {
  return {
    getId: () => 'element',
    isApplicable: languageId => languageId === 'vue-html',
    collectTags(collector) {
      for (const tagName in tags) {
        collector(tagName, tags[tagName].description);
      }
    },
    collectAttributes(tag, collector) {
      if (!tags[tag]) {
        return;
      }
      const attrs = tags[tag].attributes;
      if (!attrs) {
        return;
      }
      for (let attr of attrs) {
        const detail = findAttributeDetail(tag, attr);
        collector(attr, undefined, detail && detail.description);
      }
    },
    collectValues(tag, attr, collector) {
      if (!tags[tag]) {
        return;
      }
      const attrs = tags[tag].attributes;
      if (!attrs || attrs.indexOf(attr) < 0) {
        return;
      }
      const detail = findAttributeDetail(tag, attr);
      if (!detail || !detail.options) {
        return;
      }
      for (const option of detail.options) {<commit_msg>fix description not found bug (#238)<commit_after>import { IHTMLTagProvider } from './common';
import * as tags from 'element-helper-json/element-tags.json';
import * as attributes from 'element-helper-json/element-attributes.json';

export function getElementTagProvider(): IHTMLTagProvider {
  return {
    getId: () => 'element',
    isApplicable: languageId => languageId === 'vue-html',
    collectTags(collector) {
      for (const tagName in tags) {
        collector(tagName, tags[tagName].description || '');
      }
    },
    collectAttributes(tag, collector) {
      if (!tags[tag]) {
        return;
      }
      const attrs = tags[tag].attributes;
      if (!attrs) {
        return;
      }
      for (let attr of attrs) {
        const detail = findAttributeDetail(tag, attr);
        collector(attr, undefined, detail && detail.description || '');
      }
    },
    collectValues(tag, attr, collector) {
      if (!tags[tag]) {
        return;
      }
      const attrs = tags[tag].attributes;
      if (!attrs || attrs.indexOf(attr) < 0) {
        return;
      }
      const detail = findAttributeDetail(tag, attr);
      if (!detail || !detail.options) {
        return;
      }
      for (const option of detail.options) {
{'fraction_non_alphanumeric': 0.13319755600814664, 'fraction_numerical': 0.002036659877800407, 'mean_word_length': 2.518624641833811, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '822472', 'n_tokens_mistral': 711, 'n_tokens_neox': 708, 'n_words': 173}