Add completion after inserting ::
It is used in java 8 to reference methods
This commit is contained in:
parent
010262e181
commit
2e8f62cc22
|
@ -11,12 +11,24 @@
|
|||
(defun spacemacs/java-completing-dot ()
|
||||
"Insert a period and show company completions."
|
||||
(interactive "*")
|
||||
(when (s-matches? (rx (+ (not space)))
|
||||
(buffer-substring (line-beginning-position) (point)))
|
||||
(delete-horizontal-space t))
|
||||
(spacemacs//java-delete-horizontal-space)
|
||||
(insert ".")
|
||||
(company-emacs-eclim 'interactive))
|
||||
|
||||
(defun spacemacs/java-completing-double-colon ()
|
||||
"Insert double colon and show company completions."
|
||||
(interactive "*")
|
||||
(spacemacs//java-delete-horizontal-space)
|
||||
(insert ":")
|
||||
(let ((curr (point)))
|
||||
(when (s-matches? (buffer-substring (- curr 2) (- curr 1)) ":")
|
||||
(company-emacs-eclim 'interactive))))
|
||||
|
||||
(defun spacemacs//java-delete-horizontal-space ()
|
||||
(when (s-matches? (rx (+ (not space)))
|
||||
(buffer-substring (line-beginning-position) (point)))
|
||||
(delete-horizontal-space t)))
|
||||
|
||||
(defun spacemacs/java-maven-test ()
|
||||
(interactive)
|
||||
(eclim-maven-run "test"))
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
(evil-define-key 'insert java-mode-map
|
||||
(kbd ".") 'spacemacs/java-completing-dot
|
||||
(kbd ":") 'spacemacs/java-completing-double-colon
|
||||
(kbd "M-.") 'eclim-java-find-declaration
|
||||
(kbd "M-,") 'pop-tag-mark
|
||||
(kbd "M-<mouse-3>") 'eclim-java-find-declaration
|
||||
|
|
Loading…
Reference in a new issue