2015-01-12 04:22:23 +00:00
|
|
|
(defvar go-pre-extensions
|
|
|
|
'(
|
|
|
|
;; pre extension gos go here
|
|
|
|
)
|
|
|
|
"List of all extensions to load before the packages.")
|
|
|
|
|
|
|
|
(defvar go-post-extensions
|
|
|
|
'(
|
|
|
|
;; post extension gos go here
|
|
|
|
go-oracle
|
2015-02-07 01:03:40 +00:00
|
|
|
go-rename
|
2015-01-12 04:22:23 +00:00
|
|
|
)
|
|
|
|
"List of all extensions to load after the packages.")
|
|
|
|
|
|
|
|
;; For each extension, define a function go/init-<extension-go>
|
|
|
|
;;
|
|
|
|
;; (defun go/init-my-extension ()
|
|
|
|
;; "Initialize my extension"
|
|
|
|
;; )
|
|
|
|
;;
|
|
|
|
;; Often the body of an initialize function uses `use-package'
|
|
|
|
;; For more info on `use-package', see readme:
|
|
|
|
;; https://github.com/jwiegley/use-package
|
|
|
|
|
2015-02-15 15:53:03 +00:00
|
|
|
(defun load-gopath-file(gopath name)
|
|
|
|
"Search for NAME file in all paths referenced in GOPATH."
|
|
|
|
(setq paths (split-string gopath ":"))
|
|
|
|
(loop for p in paths
|
|
|
|
for file = (concat p name) when (file-exists-p file)
|
|
|
|
do (load-file file)))
|
|
|
|
|
2015-01-12 04:22:23 +00:00
|
|
|
(defun go/init-go-oracle()
|
2015-02-15 03:44:06 +00:00
|
|
|
(let ((go-path (getenv "GOPATH")))
|
|
|
|
(if (not go-path)
|
|
|
|
(spacemacs/message (concat "Warning: GOPATH variable not found, "
|
|
|
|
"go-oracle configuration skipped."))
|
2015-02-18 20:11:51 +00:00
|
|
|
(load-gopath-file go-path "/src/code.google.com/p/go.tools/cmd/oracle/oracle.el")
|
2015-02-15 03:44:06 +00:00
|
|
|
(load-file (concat (file-name-as-directory go-path)
|
|
|
|
"src/code.google.com/p/go.tools/cmd/oracle/oracle.el"))
|
|
|
|
(add-hook 'go-mode-hook 'go-oracle-mode)
|
|
|
|
(spacemacs|diminish go-oracle-mode " O")
|
|
|
|
(evil-leader/set-key-for-mode 'go-mode
|
|
|
|
"moo" 'go-oracle-set-scope
|
|
|
|
"mo<" 'go-oracle-callers
|
|
|
|
"mo>" 'go-oracle-callees
|
|
|
|
"moc" 'go-oracle-peers
|
|
|
|
"mod" 'go-oracle-definition
|
|
|
|
"mof" 'go-oracle-freevars
|
|
|
|
"mog" 'go-oracle-callgraph
|
|
|
|
"moi" 'go-oracle-implements
|
|
|
|
"mop" 'go-oracle-pointsto
|
|
|
|
"mor" 'go-oracle-referrers
|
|
|
|
"mos" 'go-oracle-callstack
|
2015-02-15 15:53:03 +00:00
|
|
|
"mot" 'go-oracle-describe))))
|
2015-02-07 01:03:40 +00:00
|
|
|
|
|
|
|
(defun go/init-go-rename()
|
2015-02-08 04:26:27 +00:00
|
|
|
(use-package go-rename
|
|
|
|
:init
|
|
|
|
(evil-leader/set-key-for-mode 'go-mode "mr" 'go-rename)))
|