-_ = require 'underscore-plus'
-path = require 'path'
-fs = require 'fs-plus'
 {Emitter, Disposable, BufferedProcess, CompositeDisposable} = require 'atom'
 
 Base = require './base'
-generateIntrospectionReport = null
 settings = require './settings'
 getEditorState = null
 
-invalidateRequireCacheForPackage = (packPath) ->
-  Object.keys(require.cache)
-    .filter (p) -> p.startsWith(packPath + path.sep)
-    .forEach (p) -> delete require.cache[p]
-
 class Developer
-  init: (service) ->
-    {getEditorState} = service
+  init: (_getEditorState) ->
+    getEditorState = _getEditorState
     @devEnvironmentByBuffer = new Map
     @reloadSubscriptionByBuffer = new Map
 

    atom.commands.add('atom-text-editor', "vim-mode-plus:#{name}", fn)

  clearDebugOutput: (name, fn) ->
    filePath = fs.normalize(settings.get('debugOutputFilePath'))
    options = {searchAllPanes: true, activatePane: false}
    atom.workspace.open(filePath, options).then (editor) ->
      editor.setText('')

    console.log 'total', inspect(total)

  reload: (reloadDependencies) ->
    pathSeparator = require('path').sep

    packages = ['vim-mode-plus']
    if reloadDependencies
      packages.push(settings.get('devReloadPackages')...)

    invalidateRequireCacheForPackage = (packPath) ->
      Object.keys(require.cache)
        .filter (p) -> p.startsWith(packPath + pathSeparator)
        .forEach (p) -> delete require.cache[p]

    deactivate = (packName) ->
      console.log "- deactivating #{packName}"
