           @emitBackendStatus 'error'
 
   getTargets: ->
-    # TODO: get targets for current project
+    [cabalRoot, cabalFile] = @findCabalFile atom.project.getPaths()[0]
+    new Promise (resolve) =>
+      @parseCabalFile (path.join cabalRoot, cabalFile), (cabalParsed) ->
+        resolve cabalParsed
 
   getMenu: ->
     label: 'Cabal'
     submenu: [
-      # This is obviously an example.
       {label: 'Test', command: 'ide-haskell-cabal:test'}
     ]

      when '7.10' then atom.config.get 'ide-haskell-cabal.' + opt + '710'
    return value.trim()

  cabalBuild: (cmd, callbacks) =>
    # TODO: It shouldn't be possible to call this function until cabalProcess
    # exits. Otherwise, problems will ensue.
    # TODO: Might want to check _either_ the project path _or_ starting from

    #editor    = atom.workspace.activePaneItem
    #editorCwd = path.dirname(editor.getPath())
    #cabalRoot = findCabalRoot editorCwd
    target = opts.target

    [cabalRoot, cabalFile] = @findCabalFile atom.project.getPaths()[0]
    buildDir = @getConfigOpt 'buildDir'

    if cabalFile?
      cabalArgs =
        switch cmd
          when 'build', 'test'
            [cmd, '--only', '--builddir=' + buildDir]
          else
            [cmd, '--builddir=' + buildDir]
      cabalArgs.push target if target? and cmd is 'build'
      cabalProcess = new CabalProcess 'cabal', cabalArgs, @spawnOpts(cabalRoot), opts
    else
      @emitMessages [
        message: "No cabal file found"
