go: replace deprecated oracle with guru
change to prefix for guru commands from `mr` to `mf` to separate from rename commands. Better prefix? Fixes #6772.
This commit is contained in:
parent
146aa55af3
commit
f609a25585
|
@ -13,7 +13,7 @@
|
||||||
- [[#tests][Tests]]
|
- [[#tests][Tests]]
|
||||||
- [[#working-with-go][Working with Go]]
|
- [[#working-with-go][Working with Go]]
|
||||||
- [[#go-commands-start-with-m][Go commands (start with =m=):]]
|
- [[#go-commands-start-with-m][Go commands (start with =m=):]]
|
||||||
- [[#go-oracle][Go Oracle]]
|
- [[#go-guru][Go Guru]]
|
||||||
|
|
||||||
* Description
|
* Description
|
||||||
This layer adds extensive support for go.
|
This layer adds extensive support for go.
|
||||||
|
@ -21,7 +21,7 @@ This layer adds extensive support for go.
|
||||||
** Features:
|
** Features:
|
||||||
- gofmt/goimports on file save
|
- gofmt/goimports on file save
|
||||||
- Auto-completion using [[https://github.com/nsf/gocode/tree/master/emacs][go-autocomplete]] (with the =auto-completion= layer)
|
- Auto-completion using [[https://github.com/nsf/gocode/tree/master/emacs][go-autocomplete]] (with the =auto-completion= layer)
|
||||||
- Source analysis using [[http://golang.org/s/oracle-user-manual][go-oracle]]
|
- Source analysis using [[https://godoc.org/golang.org/x/tools/cmd/guru][go-guru]]
|
||||||
- Linting with flycheck's built-in checkers or flycheck-gometalinter
|
- Linting with flycheck's built-in checkers or flycheck-gometalinter
|
||||||
- Coverage profile visualization
|
- Coverage profile visualization
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ You will need =gocode= and =godef=:
|
||||||
#+BEGIN_SRC sh
|
#+BEGIN_SRC sh
|
||||||
go get -u -v github.com/nsf/gocode
|
go get -u -v github.com/nsf/gocode
|
||||||
go get -u -v github.com/rogpeppe/godef
|
go get -u -v github.com/rogpeppe/godef
|
||||||
go get -u -v golang.org/x/tools/cmd/oracle
|
go get -u -v golang.org/x/tools/cmd/guru
|
||||||
go get -u -v golang.org/x/tools/cmd/gorename
|
go get -u -v golang.org/x/tools/cmd/gorename
|
||||||
go get -u -v golang.org/x/tools/cmd/goimports
|
go get -u -v golang.org/x/tools/cmd/goimports
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
@ -119,19 +119,19 @@ The default value is =display-buffer-reuse-window=.
|
||||||
| ~SPC m t t~ | run "go test" for the function you're currently in (while you're in a _.test.go file) |
|
| ~SPC m t t~ | run "go test" for the function you're currently in (while you're in a _.test.go file) |
|
||||||
| ~SPC m t s~ | run "go test" for the suite you're currently in (requires gocheck) |
|
| ~SPC m t s~ | run "go test" for the suite you're currently in (requires gocheck) |
|
||||||
|
|
||||||
** Go Oracle
|
** Go Guru
|
||||||
|
|
||||||
| Key Binding | Description |
|
| Key Binding | Description |
|
||||||
|-------------+------------------------------------------------------------|
|
|-------------+------------------------------------------------------|
|
||||||
| ~SPC m r o~ | go-oracle set analysis scope |
|
| ~SPC m f d~ | go-guru describe symbol at point |
|
||||||
| ~SPC m r <~ | go-oracle show possible callers |
|
| ~SPC m f f~ | go-guru show free variables |
|
||||||
| ~SPC m r >~ | go-oracle show call targets |
|
| ~SPC m f i~ | go-guru show implements relation |
|
||||||
| ~SPC m r c~ | go-oracle show channel sends/receives |
|
| ~SPC m f c~ | go-guru show channel sends/receives |
|
||||||
| ~SPC m r d~ | go-oracle show definition |
|
| ~SPC m f r~ | go-guru show referrers |
|
||||||
| ~SPC m r f~ | go-oracle show free variables |
|
| ~SPC m f j~ | go-guru jump to symbol definition |
|
||||||
| ~SPC m r g~ | go-oracle show callgraph |
|
| ~SPC m f p~ | go-guru show what the select expression points to |
|
||||||
| ~SPC m r i~ | go-oracle show implements relation |
|
| ~SPC m f s~ | go-guru show callstack |
|
||||||
| ~SPC m r p~ | go-oracle show what the select expression points to |
|
| ~SPC m f e~ | go-guru show possible contants/types for error value |
|
||||||
| ~SPC m r r~ | go-oracle show all references to object |
|
| ~SPC m f <~ | go-guru show possible callers |
|
||||||
| ~SPC m r s~ | go-oracle show callstack |
|
| ~SPC m f >~ | go-guru show call targets |
|
||||||
| ~SPC m r t~ | go-oracle describe selected syntax, kind, type and methods |
|
| ~SPC m f o~ | go-guru set analysis scope |
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
helm-gtags
|
helm-gtags
|
||||||
go-eldoc
|
go-eldoc
|
||||||
go-mode
|
go-mode
|
||||||
(go-oracle :location site)
|
(go-guru :location site)
|
||||||
(go-rename :location local)
|
(go-rename :location local)
|
||||||
))
|
))
|
||||||
|
|
||||||
|
@ -112,31 +112,32 @@
|
||||||
(defun go/init-go-eldoc()
|
(defun go/init-go-eldoc()
|
||||||
(add-hook 'go-mode-hook 'go-eldoc-setup))
|
(add-hook 'go-mode-hook 'go-eldoc-setup))
|
||||||
|
|
||||||
(defun go/init-go-oracle()
|
(defun go/init-go-guru()
|
||||||
(let ((go-path (getenv "GOPATH")))
|
(let ((go-path (getenv "GOPATH")))
|
||||||
(if (not go-path)
|
(if (not go-path)
|
||||||
(spacemacs-buffer/warning
|
(spacemacs-buffer/warning
|
||||||
"GOPATH variable not found, go-oracle configuration skipped.")
|
"GOPATH variable not found, go-guru configuration skipped.")
|
||||||
(when (load-gopath-file
|
(when (load-gopath-file
|
||||||
go-path "/src/golang.org/x/tools/cmd/oracle/oracle.el")
|
go-path "/src/golang.org/x/tools/cmd/guru/go-guru.el")
|
||||||
(spacemacs/declare-prefix-for-mode 'go-mode "mr" "rename")
|
(spacemacs/declare-prefix-for-mode 'go-mode "mf" "guru")
|
||||||
(spacemacs/set-leader-keys-for-major-mode 'go-mode
|
(spacemacs/set-leader-keys-for-major-mode 'go-mode
|
||||||
"ro" 'go-oracle-set-scope
|
"fd" 'go-guru-describe
|
||||||
"r<" 'go-oracle-callers
|
"ff" 'go-guru-freevars
|
||||||
"r>" 'go-oracle-callees
|
"fi" 'go-guru-implements
|
||||||
"rc" 'go-oracle-peers
|
"fc" 'go-guru-peers
|
||||||
"rd" 'go-oracle-definition
|
"fr" 'go-guru-referrers
|
||||||
"rf" 'go-oracle-freevars
|
"fj" 'go-guru-definition
|
||||||
"rg" 'go-oracle-callgraph
|
"fp" 'go-guru-pointsto
|
||||||
"ri" 'go-oracle-implements
|
"fs" 'go-guru-callstack
|
||||||
"rp" 'go-oracle-pointsto
|
"fe" 'go-guru-whicherrs
|
||||||
"rr" 'go-oracle-referrers
|
"f<" 'go-guru-callers
|
||||||
"rs" 'go-oracle-callstack
|
"f>" 'go-guru-callees
|
||||||
"rt" 'go-oracle-describe)))))
|
"fo" 'go-guru-set-scope)))))
|
||||||
|
|
||||||
(defun go/init-go-rename()
|
(defun go/init-go-rename()
|
||||||
(use-package go-rename
|
(use-package go-rename
|
||||||
:init
|
:init
|
||||||
|
(spacemacs/declare-prefix-for-mode 'go-mode "mr" "rename")
|
||||||
(spacemacs/set-leader-keys-for-major-mode 'go-mode "rn" 'go-rename)))
|
(spacemacs/set-leader-keys-for-major-mode 'go-mode "rn" 'go-rename)))
|
||||||
|
|
||||||
(defun go/init-flycheck-gometalinter()
|
(defun go/init-flycheck-gometalinter()
|
||||||
|
|
Loading…
Reference in New Issue