(make-variable-buffer-local 'company-eclim--doc)
(declare-function json-read "json")
+(defvar json-array-type)
(defun company-eclim--call-process (&rest args)
(let ((coding-system-for-read 'utf-8)
(defun company-eclim--candidates (prefix)
(interactive "d")
(let ((project-file (file-relative-name buffer-file-name
- (company-eclim--project-dir)))
- (project-name (company-eclim--project-name)))
+ (company-eclim--project-dir))))
(when company-eclim-auto-save
(when (buffer-modified-p)
(basic-save-buffer))
(defun company-eclim--meta (candidate)
(gethash candidate company-eclim--doc))
+(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)))
+
(defun company-eclim (command &optional arg &rest ignored)
"`company-mode' completion back-end for Eclim.
Eclim provides access to Eclipse Java IDE features for other editors.
company-eclim-executable
(company-eclim--project-name)
(not (company-in-string-or-comment))
- (or (company-grab-symbol) 'stop)))
+ (or (company-eclim--prefix) 'stop)))
(candidates (company-eclim--candidates arg))
(meta (company-eclim--meta arg))
;; because "" doesn't return everything