     if withQuotes then withQuotes[1] else text
 
   getLoadedModules: ->
-    @runCmd "print"
+    @runCmd { command: "list" }
       .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
+    @runCmd
+      command: "complete"
+      params:
+        filters: [
+          {
+            filter: "prefix"
+            params:
+              search: text
+          }
+          {
+            filter: "modules"
+            params:
+              modules: modules
+          }
+        ]
 
   getType: (text) ->
-    @runCmd "typeLookup #{text}"
-      .then (result) =>
-        result = result.trim()
-        if result.indexOf("not found") != -1 then "" else result
+    @runCmd
+      command: "type"
+      params:
+        search: text
+        filters: []
+    .then (result) =>
+      if result.length > 0
+        @abbrevType result[0].type
+      else
+        ""
 
   abbrevType: (type) ->
     type.replace(/(?:\w+\.)+(\w+)/g, "$1")

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


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

