+{fs} = require 'atom'
 ipc = require 'ipc'
 path = require 'path'
 Q = require 'q'

    editSession = activePane.itemForUri(filePath) if activePane and filePath
    promise = project.openAsync(filePath, {initialLine}) if not editSession

    returnedPromise = Q(editSession ? promise)
    returnedPromise.done (editSession) =>
      if not activePane
        activePane = new Pane(editSession)
        @panes.setRoot(activePane)

      activePane.showItem(editSession)
      activePane.focus()

    returnedPromise

  # Private: DEPRECATED Synchronously Opens a given a filepath in Atom.
  open: (filePath, options = {}) ->
    changeFocus = options.changeFocus ? true
    initialLine = options.initialLine
    filePath = project.relativize(filePath)

  #
  # Returns a promise that resolves to the {EditSession} for the file URI.
  openAsync: (filePath, options={}) ->
    absoluteFilePath = filePath
    filePath = project.relativize(filePath)
    initialLine = options.initialLine
    activePane = @getActivePane()
