This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+lang/java/funcs.el

44 lines
1.2 KiB
EmacsLisp
Raw Normal View History

;;; packages.el --- Java functions File for Spacemacs
;;
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;;
;; Author: Lukasz Klich <klich.lukasz@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defun spacemacs/java-completing-dot ()
2015-05-20 21:06:46 +00:00
"Insert a period and show company completions."
(interactive "*")
(spacemacs//java-delete-horizontal-space)
2015-05-20 21:06:46 +00:00
(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 ()
2015-05-20 21:06:46 +00:00
(interactive)
(eclim-maven-run "test"))
(defun spacemacs/java-maven-clean-install ()
2015-05-20 21:06:46 +00:00
(interactive)
(eclim-maven-run "clean install"))
(defun spacemacs/java-maven-install ()
2015-05-20 21:06:46 +00:00
(interactive)
(eclim-maven-run "install"))