<commit_before>'use babel'

import {CompositeDisposable, Emitter} from 'atom'

export default class Editor {
  constructor(textEditor, connection) {
    this.subscriptions = new CompositeDisposable()
    this.emitter = new Emitter()

    this.subscriptions.add(this.emitter)
    this.subscriptions.add(atom.config.observe('steel-flint.liveReload', liveReload => {
      this.liveReload = liveReload
    }))
    this.subscriptions.add(textEditor.onDidDestroy(() => {
      this.dispose()
    }))

    this.subscriptions.add(textEditor.onDidChange(() => {
      if (this.liveReload) {
        const filePath = textEditor.getPath()
        const fileContents = textEditor.getText()
        connection.send('live:save', {path: filePath, contents: fileContents})
      }
    }))
  }
  onShouldReload(callback) {
    return this.emitter.on('should-reload', callback)
  }
  onDidDestroy(callback) {
    return this.emitter.on('did-destroy', callback)
  }
  dispose() {
    this.emitter.emit('did-destroy')
    this.subscriptions.dispose()
  }
}
<commit_msg>:fire: Remove an unnecessary event from editor<commit_after>'use babel'

import {CompositeDisposable, Emitter} from 'atom'

export default class Editor {
  constructor(textEditor, connection) {
    this.subscriptions = new CompositeDisposable()
    this.emitter = new Emitter()

    this.subscriptions.add(this.emitter)
    this.subscriptions.add(atom.config.observe('steel-flint.liveReload', liveReload => {
      this.liveReload = liveReload
    }))
    this.subscriptions.add(textEditor.onDidDestroy(() => {
      this.dispose()
    }))

    this.subscriptions.add(textEditor.onDidChange(() => {
      if (this.liveReload) {
        const filePath = textEditor.getPath()
        const fileContents = textEditor.getText()
        connection.send('live:save', {path: filePath, contents: fileContents})
      }
    }))
  }
  onDidDestroy(callback) {
    return this.emitter.on('did-destroy', callback)
  }
  dispose() {
    this.emitter.emit('did-destroy')
    this.subscriptions.dispose()
  }
}

{'fraction_non_alphanumeric': 0.13391984359726294, 'fraction_numerical': 0.0, 'mean_word_length': 3.5287610619469025, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '2073837', 'n_tokens_mistral': 657, 'n_tokens_neox': 629, 'n_words': 104}