2022-10-20 04:03:56 +00:00
|
|
|
(require 'common-lsp)
|
|
|
|
(require 'util-tree-sitter)
|
|
|
|
|
|
|
|
(use-package go-mode
|
2023-05-27 19:19:08 +00:00
|
|
|
:pin nongnu
|
|
|
|
:commands (go-mode go-ts-mode)
|
2022-10-20 04:03:56 +00:00
|
|
|
:hook (
|
2023-05-27 19:19:08 +00:00
|
|
|
(go-ts-mode . (lambda ()
|
|
|
|
(when-linux
|
|
|
|
(eglot-ensure)
|
|
|
|
)
|
2022-10-20 04:03:56 +00:00
|
|
|
))
|
|
|
|
;; (before-save . lsp-format-buffer)
|
|
|
|
)
|
2023-05-27 19:19:08 +00:00
|
|
|
: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))
|
2022-10-20 04:03:56 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
(provide 'lang-go)
|