forked from dgutov/robe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrobe-ac.el
31 lines (26 loc) · 894 Bytes
/
robe-ac.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
(eval-when-compile (require 'robe))
(defun robe-ac-doc (symbol)
"Return popup documentation for `auto-complete'."
(when robe-running
(let ((spec (car (robe-cached-specs symbol))))
(when spec
(concat (robe-signature spec)
"\n\n"
(cdr (assoc 'docstring (robe-doc-for spec))))))))
;;;###autoload
(defun robe-ac-available ()
"Return t if `robe-mode' completions are available, otherwise nil."
(and (boundp 'robe-mode) robe-mode))
(defun robe-ac-candidates ()
"Return completion candidates for `ac-prefix'."
(require 'robe)
(when robe-running
(robe-complete-thing ac-prefix)))
;;;###autoload
(defconst ac-source-robe
'((available . robe-ac-available)
(candidates . robe-ac-candidates)
(document . robe-ac-doc)
(symbol . "r"))
"`auto-complete' completion source for Ruby using `robe-mode'.")
(provide 'robe-ac)