 swankProtocol = require './swank-protocol'
 {Subscriber} = require 'emissary'
 
+ensimeMessageCounter = 1
+client = null
 
-ensimeMessageCounter = 1
 
 _portFile = null
 portFile = ->

  swankProtocol.buildMessage("(:swank-rpc #{msg} #{ensimeMessageCounter++})")

readDotEnsime = -> # TODO: error handling
  fs.readFileSync(atom.project.getPath() + '/.ensime')

startEnsime = (portFile) ->
  ensimeLocation = '~/dev/projects/ensime-src/dist'

      atom.workspaceView.statusBar?.appendLeft('<span>Starting Ensime server?</span>')

    atom.workspaceView.command "ensime:init", => @initEnsime()
    atom.workspaceView.command "ensime:start-server", => @startEnsime()
    atom.workspaceView.command "ensime:typecheck-all", => @typecheckAll()
    atom.workspaceView.command "ensime:init-builder", => @initBuilder()
    @ensimeView = new EnsimeView(state.ensimeViewState)

  deactivate: ->
