mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-23 19:40:24 +10:00
Updating Doom Emacs.
This commit is contained in:
@@ -15,7 +15,8 @@
|
||||
- [[#troubleshooting][Troubleshooting]]
|
||||
|
||||
* Description
|
||||
This module adds [[https://golang.org][Go]] support.
|
||||
This module adds [[https://golang.org][Go]] support, with optional (but recommended) LSP support via
|
||||
[[https://github.com/golang/tools/blob/master/gopls/README.md][gopls]].
|
||||
|
||||
+ Code completion (~gocode~)
|
||||
+ Documentation lookup (~godoc~)
|
||||
@@ -30,7 +31,8 @@ This module adds [[https://golang.org][Go]] support.
|
||||
+ Code checking (~flycheck-golangci-lint~)
|
||||
|
||||
** Module Flags
|
||||
+ =+lsp= Enables integration for the gopls LSP server.
|
||||
+ =+lsp= Enables integration for the gopls LSP server. It is highly recommended
|
||||
you use this, as the non-LSP experience is deprecated (and poor).
|
||||
|
||||
** Plugins
|
||||
+ [[https://github.com/dominikh/go-mode.el][go-mode]]
|
||||
@@ -38,9 +40,9 @@ This module adds [[https://golang.org][Go]] support.
|
||||
+ [[https://github.com/dominikh/go-mode.el][go-guru]]
|
||||
+ [[https://github.com/manute/gorepl-mode][gorepl-mode]]
|
||||
+ [[https://github.com/brantou/emacs-go-tag][go-tag]]
|
||||
+ [[https://github.com/mdempsky/gocode][company-go]]*
|
||||
+ [[https://github.com/mdempsky/gocode][company-go]]* =DEPRECATED=
|
||||
+ [[https://github.com/s-kostyaev/go-gen-test][go-gen-test]]
|
||||
+ [[https://github.com/weijiangan/flycheck-golangci-lint][flycheck-golangci-lint]] (if =:tools flycheck= is enabled)
|
||||
+ [[https://github.com/weijiangan/flycheck-golangci-lint][flycheck-golangci-lint]] (if =:checkers syntax= is enabled)
|
||||
|
||||
* Prerequisites
|
||||
** Go
|
||||
@@ -77,7 +79,7 @@ This module requires a valid ~GOPATH~, and the following Go packages:
|
||||
export GOPATH=~/work/go
|
||||
|
||||
go get -u github.com/motemen/gore/cmd/gore
|
||||
go get -u github.com/mdempsky/gocode
|
||||
go get -u github.com/stamblerre/gocode
|
||||
go get -u golang.org/x/tools/cmd/godoc
|
||||
go get -u golang.org/x/tools/cmd/goimports
|
||||
go get -u golang.org/x/tools/cmd/gorename
|
||||
|
||||
@@ -41,6 +41,21 @@
|
||||
(+go--run-tests (concat "-run" "='" (match-string-no-properties 2) "'")))
|
||||
(error "Must be in a _test.go file")))
|
||||
|
||||
;;;###autoload
|
||||
(defun +go/bench-all ()
|
||||
(interactive)
|
||||
(+go--run-tests "-test.run=NONE -test.bench=\".*\""))
|
||||
|
||||
;;;###autoload
|
||||
(defun +go/bench-single ()
|
||||
(interactive)
|
||||
(if (string-match "_test\\.go" buffer-file-name)
|
||||
(save-excursion
|
||||
(re-search-backward "^func[ ]+\\(([[:alnum:]]*?[ ]?[*]?[[:alnum:]]+)[ ]+\\)?\\(Benchmark[[:alnum:]_]+\\)(.*)")
|
||||
(+go--run-tests (concat "-test.run=NONE -test.bench" "='" (match-string-no-properties 2) "'")))
|
||||
(error "Must be in a _test.go file")))
|
||||
|
||||
|
||||
;;;###autoload
|
||||
(defun +go/play-buffer-or-region (&optional beg end)
|
||||
"TODO"
|
||||
|
||||
@@ -44,10 +44,10 @@
|
||||
(:prefix ("ri" . "imports")
|
||||
"a" #'go-import-add
|
||||
"r" #'go-remove-unused-imports)
|
||||
(:prefix ( "b" . "build")
|
||||
:desc "go run ." "r" (λ! (compile "go run ."))
|
||||
:desc "go build" "b" (λ! (compile "go build"))
|
||||
:desc "go clean" "c" (λ! (compile "go clean")))
|
||||
(:prefix ("b" . "build")
|
||||
:desc "go run ." "r" (cmd! (compile "go run ."))
|
||||
:desc "go build" "b" (cmd! (compile "go build"))
|
||||
:desc "go clean" "c" (cmd! (compile "go clean")))
|
||||
(:prefix ("t" . "test")
|
||||
"t" #'+go/test-rerun
|
||||
"a" #'+go/test-all
|
||||
@@ -55,7 +55,10 @@
|
||||
"n" #'+go/test-nested
|
||||
"g" #'go-gen-test-dwim
|
||||
"G" #'go-gen-test-all
|
||||
"e" #'go-gen-test-exported)))
|
||||
"e" #'go-gen-test-exported
|
||||
(:prefix ("b" . "bench")
|
||||
"s" #'+go/bench-single
|
||||
"a" #'+go/bench-all))))
|
||||
|
||||
|
||||
(use-package! gorepl-mode
|
||||
@@ -71,5 +74,5 @@
|
||||
(setq company-go-show-annotation t))
|
||||
|
||||
(use-package! flycheck-golangci-lint
|
||||
:when (featurep! :tools flycheck)
|
||||
:when (featurep! :checkers syntax)
|
||||
:hook (go-mode . flycheck-golangci-lint-setup))
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/go/packages.el
|
||||
|
||||
(package! go-eldoc)
|
||||
(package! go-guru)
|
||||
(package! go-mode)
|
||||
(package! gorepl-mode)
|
||||
(package! go-tag)
|
||||
(package! go-gen-test)
|
||||
(package! go-eldoc :pin "cbbd2ea1e94a36004432a9ac61414cb5a95a39bd")
|
||||
(package! go-guru :pin "734d5232455ffde088021ea5908849ac570e890f")
|
||||
(package! go-mode :pin "734d5232455ffde088021ea5908849ac570e890f")
|
||||
(package! gorepl-mode :pin "6a73bf352e8d893f89cad36c958c4db2b5e35e07")
|
||||
(package! go-tag :pin "59b243f2fa079d9de9d56f6e2d94397e9560310a")
|
||||
(package! go-gen-test :pin "44c202ac97e728e93a35cee028a0ea8dd6e4292c")
|
||||
|
||||
(when (featurep! :completion company)
|
||||
(package! company-go))
|
||||
(package! company-go :pin "4acdcbdea79de6b3dee1c637eca5cbea0fdbe37c"))
|
||||
|
||||
(when (featurep! :tools flycheck)
|
||||
(package! flycheck-golangci-lint))
|
||||
(when (featurep! :checkers syntax)
|
||||
(package! flycheck-golangci-lint :pin "8e446c68311048f0b87febf8ef0379e29d358851"))
|
||||
|
||||
Reference in New Issue
Block a user