 module.exports =
 class Interceptor
   constructor: ->
+    @virtualEntries = {}
     @projectPaths = atom.project.getPaths()
     @projectPaths.forEach (path) -> atom.project.removePath(path)
 

    # TODO: persist title change, maybe use custom-title package
    document.title = 'Learn IDE - ' + @virtualRoot.replace("#{@localRoot}/", '')
    @send {command: 'sync'}

  onSync: ({entries, root}) =>
    virtualEntries = convert.remoteEntries(entries, @localRoot)
    sync = new Sync(virtualEntries, "#{@localRoot}/#{root}")
    sync.execute()

  onChange: ({entries, path, parent}) =>
    console.log "CHANGE: #{path}"

      console.log "RECEIVED: #{type}"
      messageCallbacks[type]?(payload)

    @websocket.onerror = (err) ->
      console.error('error with the websocket')
      console.log(err)

  package: ->
    # todo: update package name
    atom.packages.getActivePackage('tree-view')
