<commit_before>fs = null
settings = null
utilities = null
path = null
_s = null
url = null

module.exports =
  # Local modules for JIT require
  SettingsHelper: null
  MenuManager: null
  SerialHelper: null
  StatusView: null
  LoginView: null
  SelectCoreView: null
  RenameCoreView: null
  ClaimCoreView: null
  IdentifyCoreView: null
  ListeningModeView: null
  SelectPortView: null
  CompileErrorsView: null
  CloudVariablesAndFunctions: null
  SelectFirmwareView: null

  statusView: null
  loginView: null
  selectCoreView: null
  renameCoreView: null
  claimCoreView: null
  identifyCoreView: null
  listeningModeView: null
  selectPortView: null
  compileErrorsView: null
  cloudVariablesAndFunctionsView: null
  selectFirmwareView: null
  spark: null

  removePromise: null
  listPortsPromise: null
  compileCloudPromise: null
  flashCorePromise: null

  activate: (state) ->
    # Require modules on activation
    @StatusView ?= require './views/status-bar-view'
    @SettingsHelper ?= require './utils/settings-helper'
    @MenuManager ?= require './utils/menu-manager'

    # Initialize status bar view
    @statusView = new @StatusView()

    # Hook up commands
    atom.workspaceView.command 'spark-ide:login', => @login()
    atom.workspaceView.command 'spark-ide:logout', => @logout()
    atom.workspaceView.command 'spark-ide:select-core', => @selectCore()
    atom.workspaceView.command 'spark-ide:rename-core', => @renameCore()
    atom.workspaceView.command 'spark-ide:remove-core', => @removeCore()
    atom.workspaceView.command 'spark-ide:claim-core', => @claimCore()
    atom.workspaceView.command 'spark-ide:identify-core', (event, port) => @identifyCore(port)
    atom.workspaceView.command 'spark-ide:compile-cloud', (event, thenFlash) => @compileCloud(thenFlash)
    atom.workspaceView.command 'spark-ide:show-compile-errors', => @showCompileErrors()
    atom.workspaceView.command 'spark-ide:show-cloud-variables-and-functions', => @showCloudVariablesAndFunctions()
    atom.workspaceView.command 'spark-ide:flash-cloud', (event, firmware) => @flashCloud(firmware)
    atom.workspaceView.command 'spark-ide:show-serial-monitor', => @showSerialMonitor()
    atom.workspaceView.command 'spark-ide:setup-wifi', (event, port) => @setupWifi(port)
    atom.workspaceView.command 'spark-ide:enter-wifi-credentials', (event, port, ssid, security) => @enterWifiCredentials(port, ssid, security)

    atom.workspaceView.command 'spark-ide:update-menu', => @MenuManager.update()

    # Update menu (default one in CSON file is empty)
    @MenuManager.update()

    url = require 'url'
    atom.workspace.addOpener (uriToOpen) =>
      try
        {protocol, host, pathname} = url.parse(uriToOpen)
      catch error
        return

      return unless protocol is 'spark-ide:'

      @initView pathname.substr(1)

  deactivate: ->
    @statusView?.destroy()

  serialize: ->

  configDefaults:
    # Delete .bin file after flash
    deleteFirmwareAfterFlash: true<commit_msg>Config schema instead of configDefaults<commit_after>fs = null
settings = null
utilities = null
path = null
_s = null
url = null

module.exports =
  # Local modules for JIT require
  SettingsHelper: null
  MenuManager: null
  SerialHelper: null
  StatusView: null
  LoginView: null
  SelectCoreView: null
  RenameCoreView: null
  ClaimCoreView: null
  IdentifyCoreView: null
  ListeningModeView: null
  SelectPortView: null
  CompileErrorsView: null
  CloudVariablesAndFunctions: null
  SelectFirmwareView: null

  statusView: null
  loginView: null
  selectCoreView: null
  renameCoreView: null
  claimCoreView: null
  identifyCoreView: null
  listeningModeView: null
  selectPortView: null
  compileErrorsView: null
  cloudVariablesAndFunctionsView: null
  selectFirmwareView: null
  spark: null

  removePromise: null
  listPortsPromise: null
  compileCloudPromise: null
  flashCorePromise: null

  activate: (state) ->
    # Require modules on activation
    @StatusView ?= require './views/status-bar-view'
    @SettingsHelper ?= require './utils/settings-helper'
    @MenuManager ?= require './utils/menu-manager'

    # Initialize status bar view
    @statusView = new @StatusView()

    # Hook up commands
    atom.workspaceView.command 'spark-ide:login', => @login()
    atom.workspaceView.command 'spark-ide:logout', => @logout()
    atom.workspaceView.command 'spark-ide:select-core', => @selectCore()
    atom.workspaceView.command 'spark-ide:rename-core', => @renameCore()
    atom.workspaceView.command 'spark-ide:remove-core', => @removeCore()
    atom.workspaceView.command 'spark-ide:claim-core', => @claimCore()
    atom.workspaceView.command 'spark-ide:identify-core', (event, port) => @identifyCore(port)
    atom.workspaceView.command 'spark-ide:compile-cloud', (event, thenFlash) => @compileCloud(thenFlash)
    atom.workspaceView.command 'spark-ide:show-compile-errors', => @showCompileErrors()
    atom.workspaceView.command 'spark-ide:show-cloud-variables-and-functions', => @showCloudVariablesAndFunctions()
    atom.workspaceView.command 'spark-ide:flash-cloud', (event, firmware) => @flashCloud(firmware)
    atom.workspaceView.command 'spark-ide:show-serial-monitor', => @showSerialMonitor()
    atom.workspaceView.command 'spark-ide:setup-wifi', (event, port) => @setupWifi(port)
    atom.workspaceView.command 'spark-ide:enter-wifi-credentials', (event, port, ssid, security) => @enterWifiCredentials(port, ssid, security)

    atom.workspaceView.command 'spark-ide:update-menu', => @MenuManager.update()

    # Update menu (default one in CSON file is empty)
    @MenuManager.update()

    url = require 'url'
    atom.workspace.addOpener (uriToOpen) =>
      try
        {protocol, host, pathname} = url.parse(uriToOpen)
      catch error
        return

      return unless protocol is 'spark-ide:'

      @initView pathname.substr(1)

  deactivate: ->
    @statusView?.destroy()

  serialize: ->

  config:
    # Delete .bin file after flash
    deleteFirmwareAfterFlash:
      type: 'boolean'
      default: true
{'fraction_non_alphanumeric': 0.11620592617116371, 'fraction_numerical': 0.00033107101473266014, 'mean_word_length': 4.208620689655173, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 41, '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': '1637994', 'n_tokens_mistral': 1904, 'n_tokens_neox': 1833, 'n_words': 412}