<commit_before>fs = require 'fs'
namespace = require './services/namespace.coffee'
goto = require './services/goto.coffee'

module.exports =
  config: {}

  ###*
   * Get plugin configuration
  ###
  getConfig: () ->
    @config['composer'] = atom.config.get('atom-autocomplete-php.binComposer')
    @config['php'] = atom.config.get('atom-autocomplete-php.binPhp')
    @config['autoload'] = atom.config.get('atom-autocomplete-php.autoloadPaths')
    @config['classmap'] = atom.config.get('atom-autocomplete-php.classMapFiles')
    @config['packagePath'] = atom.packages.resolvePackagePath('atom-autocomplete-php')

  ###*
   * Writes configuration in "php lib" folder
  ###
  writeConfig: () ->
    @getConfig()

    files = ""
    for file in @config.autoload
      files += "'#{file}',"

    classmaps = ""
    for classmap in @config.classmap
      classmaps += "'#{classmap}',"

    text = "<?php
      $config = array(
        'composer' => '#{@config.composer}',
        'php' => '#{@config.php}',
        'autoload' => array(#{files}),
        'classmap' => array(#{classmaps})
      );
    "

    fs.writeFileSync(@config.packagePath + '/php/tmp.php', text)

  ###*
   * Init function called on package activation
   * Register config events and write the first config
  ###
  init: () ->
    # Command for namespaces
    atom.commands.add 'atom-workspace', 'atom-autocomplete-php:namespace': =>
        namespace.createNamespace(atom.workspace.getActivePaneItem())

    atom.commands.add 'atom-workspace', 'atom-autocomplete-php:goto': =>
        goto.gotoFromEditor(atom.workspace.getActivePaneItem())

    @writeConfig()

    atom.config.onDidChange 'atom-autocomplete-php.binPhp', () =>
      @writeConfig()

    atom.config.onDidChange 'atom-autocomplete-php.binComposer', () =>
      @writeConfig()

    atom.config.onDidChange 'atom-autocomplete-php.autoloadPaths', () =>
      @writeConfig()

    atom.config.onDidChange 'atom-autocomplete-php.classMapFiles', () =>
      @writeConfig()<commit_msg>Removed goto from config<commit_after>fs = require 'fs'
namespace = require './services/namespace.coffee'

module.exports =
  config: {}

  ###*
   * Get plugin configuration
  ###
  getConfig: () ->
    @config['composer'] = atom.config.get('atom-autocomplete-php.binComposer')
    @config['php'] = atom.config.get('atom-autocomplete-php.binPhp')
    @config['autoload'] = atom.config.get('atom-autocomplete-php.autoloadPaths')
    @config['classmap'] = atom.config.get('atom-autocomplete-php.classMapFiles')
    @config['packagePath'] = atom.packages.resolvePackagePath('atom-autocomplete-php')

  ###*
   * Writes configuration in "php lib" folder
  ###
  writeConfig: () ->
    @getConfig()

    files = ""
    for file in @config.autoload
      files += "'#{file}',"

    classmaps = ""
    for classmap in @config.classmap
      classmaps += "'#{classmap}',"

    text = "<?php
      $config = array(
        'composer' => '#{@config.composer}',
        'php' => '#{@config.php}',
        'autoload' => array(#{files}),
        'classmap' => array(#{classmaps})
      );
    "

    fs.writeFileSync(@config.packagePath + '/php/tmp.php', text)

  ###*
   * Init function called on package activation
   * Register config events and write the first config
  ###
  init: () ->
    # Command for namespaces
    atom.commands.add 'atom-workspace', 'atom-autocomplete-php:namespace': =>
        namespace.createNamespace(atom.workspace.getActivePaneItem())

    @writeConfig()

    atom.config.onDidChange 'atom-autocomplete-php.binPhp', () =>
      @writeConfig()

    atom.config.onDidChange 'atom-autocomplete-php.binComposer', () =>
      @writeConfig()

    atom.config.onDidChange 'atom-autocomplete-php.autoloadPaths', () =>
      @writeConfig()

    atom.config.onDidChange 'atom-autocomplete-php.classMapFiles', () =>
      @writeConfig()
{'fraction_non_alphanumeric': 0.17145817145817147, 'fraction_numerical': 0.0, 'mean_word_length': 3.349099099099099, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 28, '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': '1953093', 'n_tokens_mistral': 1250, 'n_tokens_neox': 1208, 'n_words': 197}