mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-06 09:31:39 -05:00
Use deferred:parallel in ein:jedi-complete
Also, destructuring-bind in the callback is fixed. Previous version may work better than the current version if I use this code. But let's use this "parallel" approach until I find some glitch.
This commit is contained in:
parent
11ed4c539d
commit
6b911124ce
1 changed files with 14 additions and 9 deletions
|
@ -47,15 +47,20 @@
|
|||
d))
|
||||
|
||||
(defun ein:jedi-complete ()
|
||||
;; Should I make it parallel and call auto-complete at the end?
|
||||
(deferred:nextc (jedi:complete-request)
|
||||
(lambda ()
|
||||
(auto-complete ein:jedi-dot-complete-sources)))
|
||||
(deferred:nextc (ein:jedi--completer-complete)
|
||||
(lambda (reply)
|
||||
(destructuring-bind (matched-text matches) reply
|
||||
(ein:completer-finish-completing-ac matched-text matches
|
||||
ein:jedi-dot-complete-sources)))))
|
||||
(deferred:$
|
||||
(deferred:parallel ; or `deferred:earlier' is better?
|
||||
(jedi:complete-request)
|
||||
(ein:jedi--completer-complete))
|
||||
(deferred:nextc it
|
||||
(lambda (replies)
|
||||
(destructuring-bind (_ ((&key matched_text matches
|
||||
&allow-other-keys)
|
||||
_)) replies
|
||||
(if matches
|
||||
(ein:completer-finish-completing-ac
|
||||
matched_text matches
|
||||
ein:jedi-dot-complete-sources)
|
||||
(auto-complete ein:jedi-dot-complete-sources)))))))
|
||||
|
||||
(defun ein:jedi-dot-complete ()
|
||||
(interactive)
|
||||
|
|
Loading…
Add table
Reference in a new issue