- (gethash candidate company-eclim--doc))
-
-(defun company-eclim--templatify (call)
- (let* ((end (point))
- (beg (- (point) (length call)))
- (templ (company-template-declare-template beg end)))
- (save-excursion
- (goto-char beg)
- (while (re-search-forward "\\([(,] ?\\)\\([^ ]+ \\)\\([^ ,)]*\\)" end t)
- (let ((name (match-string 3)))
- (replace-match "\\1" t)
- (decf end (length (match-string 2)))
- (company-template-add-field templ (point) name))))
- (company-template-move-to-first templ)))
+ (get-text-property 0 'meta candidate))
+
+(defun company-eclim--annotation (candidate)
+ (let ((meta (company-eclim--meta candidate)))
+ (when (string-match "\\(([^-]*\\) -" meta)
+ (substring meta (match-beginning 1) (match-end 1)))))
+
+(defun company-eclim--prefix ()
+ (let ((prefix (company-grab-symbol)))
+ (when prefix
+ ;; Completion candidates for annotations don't include '@'.
+ (when (eq ?@ (string-to-char prefix))
+ (setq prefix (substring prefix 1)))
+ prefix)))