         item.range = Range.fromPointWithDelta(item.point, 0, searchTermLength)
 
       @getItemsWithHeaders(items)
-
-  search: (regexp, {project, filePath}) ->
-    items = []
-    args = @getConfig('agCommandArgs').split(/\s+/)
-
-    if regexp.ignoreCase
-      args.push('--ignore-case')
-    else
-      args.push('--case-sensitive')
-
-    options =
-      stdio: ['ignore', 'pipe', 'pipe']
-      env: process.env
-
-    args.push(regexp.source)
-
-    if filePath?
-      stdout = stderr = getOutputterForFile(items)
-      args.push(filePath)
-    else
-      stdout = stderr = getOutputterForProject(project, items)
-      options.cwd = project
-
-    new Promise (resolve) ->
-      runCommand(
-        command: 'ag'
-        args: args
-        stdout: stdout
-        stderr: stderr
-        exit: -> resolve(items)
-        options: options
-      )

      {relativePath, point, text} = parsed
      items.push({point, text, filePath: relativePath})

module.exports =
class Search extends SearchBase
  checkReady: ->


  getItems: (filePath) ->
    searchPromises = []
    args = @getConfig('agCommandArgs').split(/\s+/)

    for project in @options.projects ? atom.project.getPaths()
      searchPromises.push(search(@searchRegExp, {project, args, filePath}))

    searchTermLength = @searchTerm.length
    Promise.all(searchPromises).then (values) =>
