<commit_before>import { unique, filterMultiCriteria } from "./utils";
import { BeautifyData } from "./beautifier";
import { Language } from "./language";

export class LanguageManager {
  constructor(public readonly languages: Language[]) {}

  public getLanguage(data: {
    atomGrammar?: BeautifyData["atomGrammar"];
    fileExtension?: BeautifyData["fileExtension"];
    languageName?: BeautifyData["languageName"];
    sublimeSyntax?: BeautifyData["sublimeSyntax"];
  }): Language | null {
    const langs: Language[] = this.findLanguages({
      atomGrammar: data.atomGrammar,
      extension: data.fileExtension,
      name: data.languageName,
      sublimeSyntax: data.sublimeSyntax,
    });
    return langs.length > 0 ? langs[0] : null;
  }
<commit_msg>Add vscodeLanguage to getLanguage method<commit_after>import { unique, filterMultiCriteria } from "./utils";
import { BeautifyData } from "./beautifier";
import { Language } from "./language";

export class LanguageManager {
  constructor(public readonly languages: Language[]) {}

  public getLanguage(data: {
    atomGrammar?: BeautifyData["atomGrammar"];
    fileExtension?: BeautifyData["fileExtension"];
    languageName?: BeautifyData["languageName"];
    sublimeSyntax?: BeautifyData["sublimeSyntax"];
    vscodeLanguage?: BeautifyData["vscodeLanguage"];
  }): Language | null {
    const langs: Language[] = this.findLanguages({
      atomGrammar: data.atomGrammar,
      extension: data.fileExtension,
      name: data.languageName,
      sublimeSyntax: data.sublimeSyntax,
      vscodeLanguage: data.vscodeLanguage,
    });
    // Here is where we should compare the returned langs with the "data." filters to find the best match
    return langs.length > 0 ? langs[0] : null;
  }

{'fraction_non_alphanumeric': 0.1215059897318882, 'fraction_numerical': 0.0022818026240730175, 'mean_word_length': 4.347560975609756, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2449596', 'n_tokens_mistral': 505, 'n_tokens_neox': 500, 'n_words': 124}