import {CodeMirror} from 'codemirror'


export function completions(editor, complete){
      var cursor = editor.getCursor()
      var c = complete(editor.getValue(), cursor.ch)
      console.info(c)
      //debugger;
      //c.subscribe(console.warn)
      c.then(function(res){console.log('here we go', res);
        editor.showHint(
            {list:res.matches, from:{line:cursor.line, ch:res.cursor_start}, to:{line:cursor.line, ch:res.cursor_end}}
        )
      })
}

@@ -30,17 +30,18 @@
 emirror'
+;
 %0A
-
 %0A%0Aexport
@@ -176,82 +176,8 @@
 ch)%0A
-      console.info(c)%0A      //debugger;%0A      //c.subscribe(console.warn)%0A
     
@@ -199,16 +199,25 @@
 on(res)%7B
+%0A        
 console.
@@ -264,16 +264,17 @@
 howHint(
+%7B
 %0A       
@@ -276,17 +276,51 @@
         
- 
+hint:function()%7B%0A            return
  %7Blist:r
@@ -427,16 +427,29 @@
         
+  %7D%0A        %7D
 )%0A      

fix completion, one line only