go: add support for go-impl in refactoring menu

This commit is contained in:
Cosmin Cojocar 2018-04-11 13:54:35 +02:00 committed by syl20bnr
parent f12b849993
commit d47f9267e9
2 changed files with 20 additions and 12 deletions

View File

@ -35,7 +35,8 @@ This layer adds extensive support for go to Spacemacs.
* Install
** Pre-requisites
You will need =gocode=, =gogetdoc=, =godef= and =godoctor=:
You will need =gocode=, =gogetdoc=, =godef=, =godoctor= and many others
to get all the goodies of this layer:
#+BEGIN_SRC sh
go get -u -v github.com/nsf/gocode
@ -47,6 +48,7 @@ You will need =gocode=, =gogetdoc=, =godef= and =godoctor=:
go get -u -v github.com/cweill/gotests/...
go get -u github.com/haya14busa/gopkgs/cmd/gopkgs
go get -u -v github.com/davidrjenni/reftools/cmd/fillstruct
go get -u github.com/josharian/impl
#+END_SRC
If you wish to use =gometalinter= set the value of =go-use-gometalinter= to t:
@ -213,14 +215,14 @@ You have a few options to ensure you always get up to date suggestions:
** Refactoring
| Key Binding | Description |
|-------------+------------------------------------|
| ~SPC m r d~ | Add comment stubs |
| ~SPC m r e~ | Extract code as new function |
| ~SPC m r f~ | Add field tags |
| ~SPC m r F~ | Remove field tags |
| ~SPC m r n~ | Rename (with =godoctor=) |
| ~SPC m r N~ | Rename (with =go-rename=) |
| ~SPC m r N~ | Rename (with =go-rename=) |
| ~SPC m r s~ | Fill structure with default values |
| ~SPC m r t~ | Toggle declaration and assignment |
| Key Binding | Description |
|-------------+----------------------------------------------------------------|
| ~SPC m r d~ | Add comment stubs |
| ~SPC m r e~ | Extract code as new function |
| ~SPC m r f~ | Add field tags |
| ~SPC m r F~ | Remove field tags |
| ~SPC m r i~ | Generate method subs for implementing an interface (=go-impl=) |
| ~SPC m r n~ | Rename (with =godoctor=) |
| ~SPC m r N~ | Rename (with =go-rename=) |
| ~SPC m r s~ | Fill structure with default values |
| ~SPC m r t~ | Toggle declaration and assignment |

View File

@ -24,6 +24,7 @@
go-fill-struct
go-gen-test
go-guru
go-impl
go-mode
go-rename
go-tag
@ -99,6 +100,11 @@
"f>" 'go-guru-callees
"fo" 'go-guru-set-scope))
(defun go/init-go-impl()
(use-package go-impl
:init (spacemacs/set-leader-keys-for-major-mode 'go-mode
"ri" 'go-impl)))
(defun go/init-go-mode()
(use-package go-mode
:defer t