Update go for emacs29.

This commit is contained in:
Tom Alexander 2023-05-27 15:19:08 -04:00
parent 10e63f2a94
commit f5e84d6dcc
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
3 changed files with 14 additions and 5 deletions

View File

@ -26,7 +26,7 @@
(require 'lang-terraform)
;; (require 'lang-go)
(require 'lang-go)
;; (require 'lang-c)

View File

@ -2,14 +2,22 @@
(require 'util-tree-sitter)
(use-package go-mode
:commands go-mode
:pin nongnu
:commands (go-mode go-ts-mode)
:hook (
(go-mode . (lambda ()
(eglot-ensure)
(tree-sitter-hl-mode +1)
(go-ts-mode . (lambda ()
(when-linux
(eglot-ensure)
)
))
;; (before-save . lsp-format-buffer)
)
:init
(add-to-list 'major-mode-remap-alist '(go-mode . go-ts-mode))
(add-to-list 'treesit-language-source-alist '(go "https://github.com/tree-sitter/tree-sitter-go"))
(add-to-list 'treesit-language-source-alist '(gomod "https://github.com/camdencheek/tree-sitter-go-mod"))
(unless (treesit-ready-p 'go) (treesit-install-language-grammar 'go))
(unless (treesit-ready-p 'gomod) (treesit-install-language-grammar 'gomod))
)
(provide 'lang-go)

View File

@ -4,4 +4,5 @@
- aspell-en
- prettier # typescript+yaml formatting
- pyright
- gopls
state: present