<commit_before>import { LanguageMode } from '../languageModes';
import { doScaffoldComplete } from './scaffoldCompletion';

export function getVueMode(): LanguageMode {
  return {
    getId() {
      return 'vue';
    },
    doComplete(document, position) {
      return doScaffoldComplete();
    },
    onDocumentRemoved() {},
    dispose() {}
  };
}
<commit_msg>fix #367, remove duplicate bracket in scaffold completion<commit_after>import { LanguageMode } from '../languageModes';
import { doScaffoldComplete } from './scaffoldCompletion';

export function getVueMode(): LanguageMode {
  return {
    getId() {
      return 'vue';
    },
    doComplete(document, position) {
      const offset = document.offsetAt(position);
      const text = document.getText().slice(0, offset);
      const needBracket = /<\w*$/.test(text);
      const ret = doScaffoldComplete();
      // remove duplicate <
      if (needBracket) {
        ret.items.forEach(item => {
          item.insertText = item.insertText!.slice(1);
        });
      }
      return ret;
    },
    onDocumentRemoved() {},
    dispose() {}
  };
}

{'fraction_non_alphanumeric': 0.1413141314131413, 'fraction_numerical': 0.004500450045004501, 'mean_word_length': 2.888111888111888, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '2242487', 'n_tokens_mistral': 331, 'n_tokens_neox': 324, 'n_words': 71}