Created
May 3, 2016 14:31
-
-
Save gruggiero/a07d777f8be7d838423d023474a6126e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun ensime-refactor-add-hole (type) | |
"Add a hole definition and insert it at point." | |
(interactive "sHole type (default String): ") | |
(let ((hole-type (if (string= type "") | |
"String" | |
type)) | |
(hole-name "")) | |
(save-excursion | |
(scala-syntax:beginning-of-definition) | |
(save-excursion | |
(re-search-forward scala-syntax:all-definition-re) | |
(setq hole-name (concat "hole_" (thing-at-point 'symbol)))) | |
(insert "def " hole-name ": " hole-type " = ???") | |
(ensime-indent-line) | |
(insert "\n\n") | |
(ensime-indent-line)) | |
(insert hole-name))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment