Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix completion docs

  • Loading branch information...
commit f0fc77f6619547a898d62bc78b7e7251a5b31b1f 1 parent 157b58c
@aemoncannon aemoncannon authored
Showing with 19 additions and 2 deletions.
  1. +19 −2 src/main/elisp/ensime-auto-complete.el
View
21 src/main/elisp/ensime-auto-complete.el
@@ -58,7 +58,7 @@
'is-callable is-callable
'to-insert to-insert
'summary (ensime-ac-trunc-summary
- (ensime-ac-get-doc type-sig))
+ (ensime-ac-brief-type-sig type-sig))
)))
completions)
))
@@ -95,9 +95,26 @@ changes will be forgotten."
(concat (substring str 0 40) "...")
str)))
+(defun ensime-ac-brief-type-sig (type-sig)
+ "Return doc for given item."
+ ;;(ensime-ac-brief-type-sig '(((("aemon" "Person"))) "Dude"))
+ (let* ((sections (car type-sig))
+ (return-type (cadr type-sig)))
+ (if sections
+ (format "%s: %s"
+ (mapconcat
+ (lambda (section)
+ (format "(%s)"
+ (mapconcat
+ (lambda (param-pair)
+ (format "%s:%s" (car param-pair) (cadr param-pair)))
+ section ", ")))
+ sections "=>") return-type)
+ return-type)))
+
(defun ensime-ac-get-doc (item)
"Return doc for given item."
- (format "%s" item))
+ (ensime-ac-brief-type-sig (get-text-property 0 'type-sig item)))
(defun ensime-ac-candidate-to-insert (item)
"Return to-insert for given item."
Please sign in to comment.
Something went wrong with that request. Please try again.