Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

rebased

  • Loading branch information...
commit b4f30929bff12d14caca7b44c6e958fffb08b0a2 1 parent 105b1d1
@kingtim kingtim authored
Showing with 14 additions and 11 deletions.
  1. +14 −11 nrepl.el
View
25 nrepl.el
@@ -332,21 +332,24 @@ joined together.")
(defalias 'nrepl-jump-back 'pop-tag-mark)
+(defvar nrepl-completion-fn 'nrepl-completion-complete-core-fn)
+
+(defun nrepl-completion-complete-core-fn (str)
+ "Return a list of completions using complete.core/completions."
+ (let ((strlst (plist-get
+ (nrepl-send-string-sync
+ (format "(complete.core/completions \"%s\" *ns*)" str)
+ nrepl-buffer-ns)
+ :value)))
+ (when strlst
+ (car (read-from-string strlst)))))
+
(defun nrepl-complete-at-point ()
- ;; TODO: better error handling if dependency is missing
(let ((sap (symbol-at-point)))
(when (and sap (not (in-string-p)))
(let ((bounds (bounds-of-thing-at-point 'symbol)))
- (list (car bounds) (cdr bounds)
- (completion-table-dynamic
- (lambda (str)
- (let ((strlst (plist-get
- (nrepl-send-string-sync
- (format "(complete.core/completions \"%s\" *ns*)" str)
- nrepl-buffer-ns)
- :value)))
- (when strlst
- (car (read-from-string strlst)))))))))))
+ (list (car bounds) (cdr bounds)
+ (completion-table-dynamic nrepl-completion-fn))))))
(defun nrepl-eldoc-format-thing (thing)
(propertize thing 'face 'font-lock-function-name-face))
Please sign in to comment.
Something went wrong with that request. Please try again.