         @getCompletion(prefix,@editors.activeModules)
           .then (completions) =>
             resolve completions.map (c) =>
-              text: c.ident
-              displayText: c.ident + ": " + @abbrevType c.type
+              text: c.identifier
+              displayText: c.identifier + ": " + @abbrevType c.type
               description: c.type
               type: if /->/.test(c.type) then "function" else "value"
 

    if withQuotes then withQuotes[1] else text

  getLoadedModules: ->
    @runCmd "print"
      .then (output) =>
        @getList output

  getCompletion: (text, modules) ->
    @runCmd "complete #{text} Project using #{modules.join(', ')}"
      .then (output) =>
        regex = /\(([^,]+), ([^,]+), ([^,]+)\)(,|$)/g
        results = []
        XRegExp.forEach(output, regex, (match) ->
          results.push
            module: match[1]
            ident: match[2]
            type: match[3]
        )
        results

  getType: (text) ->
    @runCmd "typeLookup #{text}"
      .then (result) =>
        result = result.trim()
        if result.indexOf("not found") != -1 then "" else result

  abbrevType: (type) ->
    type.replace(/(?:\w+\.)+(\w+)/g, "$1")

  loadDeps: (editor) ->
    res = XRegExp.exec(editor.getText(), /^module (\S+) where/)
    if res
      @runCmd
        command: "load"
        params:
          dependencies: [res[1]]
    else
      Promise.resolve()

