Add function to insert types and add yank type at point

- `, i y` Add function to yank type at point but just yank type name without full
package

- `, r a` Add function to insert type for declaration,
see `https://github.com/ensime/ensime-emacs/pull/390/files`
This commit is contained in:
Diego Alvarez 2016-03-08 20:09:40 -08:00 committed by syl20bnr
parent b891e82362
commit 9b460f60e4
3 changed files with 12 additions and 0 deletions

View File

@ -202,6 +202,7 @@ disable it with
| ~SPC m i i~ | inspect type at point |
| ~SPC m i I~ | inspect type in other frame |
| ~SPC m i p~ | inspect project package |
| ~SPC m i y~ | yank type at point |
*** Server
@ -215,6 +216,7 @@ disable it with
| Key Binding | Description |
|-------------+----------------------------------------------------------------------|
| ~SPC m r a~ | add type annotation |
| ~SPC m r f~ | format source |
| ~SPC m r d~ | get rid of an intermediate variable (=ensime-refactor-inline-local=) |
| ~SPC m r D~ | get rid of an intermediate variable (=ensime-undo-peek=) |

View File

@ -101,3 +101,11 @@ point to the position of the join."
(defun scala/configure-flyspell ()
(setq-local flyspell-generic-check-word-predicate 'scala/flyspell-verify))
(defun scala/yank-type-at-point ()
"Yank to kill ring and print type at point to the minibuffer without package name."
(interactive)
(let* ((type (ensime-rpc-get-type-at-point))
(shortname (ensime-type-short-name-with-args type)))
(kill-new shortname)
(message shortname)))

View File

@ -141,11 +141,13 @@
"ii" 'ensime-inspect-type-at-point
"iI" 'ensime-inspect-type-at-point-other-frame
"ip" 'ensime-inspect-project-package
"iy" 'scala/yank-type-at-point
"nF" 'ensime-reload-open-files
"ns" 'ensime
"nS" 'ensime-gen-and-restart
"ra" 'ensime-refactor-add-type-annotation
"rd" 'ensime-refactor-diff-inline-local
"rD" 'ensime-undo-peek
"rf" 'ensime-format-source