Use go-mod-ts-mode.
This commit is contained in:
parent
34cd3b7aa4
commit
c7b8b4c510
@ -5,19 +5,25 @@
|
|||||||
:pin manual
|
:pin manual
|
||||||
:mode (
|
:mode (
|
||||||
("\\.go\\'" . go-ts-mode)
|
("\\.go\\'" . go-ts-mode)
|
||||||
("/go\\.mod\\'" . go-ts-mode)
|
("/go\\.mod\\'" . go-mod-ts-mode)
|
||||||
)
|
)
|
||||||
:commands (go-mode go-ts-mode)
|
:commands (go-ts-mode go-mod-ts-mode)
|
||||||
:hook (
|
:hook (
|
||||||
(go-ts-mode . (lambda ()
|
(go-ts-mode . (lambda ()
|
||||||
(when-linux
|
(when-linux
|
||||||
(eglot-ensure)
|
(eglot-ensure)
|
||||||
)
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
|
(go-mod-ts-mode . (lambda ()
|
||||||
|
(when-linux
|
||||||
|
(eglot-ensure)
|
||||||
|
)
|
||||||
|
))
|
||||||
|
|
||||||
;; (before-save . lsp-format-buffer)
|
;; (before-save . lsp-format-buffer)
|
||||||
)
|
)
|
||||||
:init
|
: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 '(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"))
|
(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 'go) (treesit-install-language-grammar 'go))
|
||||||
|
Loading…
Reference in New Issue
Block a user