<commit_before>"use babel";

import _ from "lodash";

class ErrorIndicatorView extends HTMLElement {
  model = null;

  createdCallback() {
    this.classList.add("inline-block");

    const messageElement = document.createElement("a");
    this.appendChild(messageElement);
    messageElement.innerText = "LaTeX compilation error";
    messageElement.addEventListener("click", () => { this.openLogFile(); });
  }

  initialize(model) {
    this.setModel(model);
  }

  setModel(model) {
    this.model = model;
  }

  openLogFile() {
    if (!this.model) { return; }

    atom.workspace.open(this.model.logFilePath).then(editor => {
      const position = this.getFirstErrorPosition();
      editor.scrollToBufferPosition(position, {center: true});
    });
  }

  openDevConsole() {
    atom.openDevTools();
    atom.executeJavaScriptInDevTools("InspectorFrontendAPI.showConsole()");
  }

  getFirstErrorPosition() {
    const position = _.first(_.pluck(this.model.errors, "logPosition"));
    return position || [0, 0];
  }
}

export default document.registerElement("latex-error-indicator", {
  prototype: ErrorIndicatorView.prototype,
});<commit_msg>:fire: Remove unused function<commit_after>"use babel";

import _ from "lodash";

class ErrorIndicatorView extends HTMLElement {
  model = null;

  createdCallback() {
    this.classList.add("inline-block");

    const messageElement = document.createElement("a");
    this.appendChild(messageElement);
    messageElement.innerText = "LaTeX compilation error";
    messageElement.addEventListener("click", () => { this.openLogFile(); });
  }

  initialize(model) {
    this.setModel(model);
  }

  setModel(model) {
    this.model = model;
  }

  openLogFile() {
    if (!this.model) { return; }

    atom.workspace.open(this.model.logFilePath).then(editor => {
      const position = this.getFirstErrorPosition();
      editor.scrollToBufferPosition(position, {center: true});
    });
  }

  getFirstErrorPosition() {
    const position = _.first(_.pluck(this.model.errors, "logPosition"));
    return position || [0, 0];
  }
}

export default document.registerElement("latex-error-indicator", {
  prototype: ErrorIndicatorView.prototype,
});
{'fraction_non_alphanumeric': 0.14337733272644515, 'fraction_numerical': 0.0018206645425580337, 'mean_word_length': 4.099767981438515, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4605435', 'n_tokens_mistral': 665, 'n_tokens_neox': 650, 'n_words': 112}