fix(go): go-{mod,work}-ts-mode

This commit is contained in:
Henrik Lissner
2025-08-31 14:25:41 +02:00
parent 98f03062b6
commit 86b6ba81ac

View File

@@ -48,18 +48,21 @@
(+go-common-config 'go-mode))
(use-package! go-ts-mode
(use-package! go-ts-mode ; 29.1+ only
:when (modulep! +tree-sitter)
:when (fboundp 'go-ts-mode) ; 31.1+ only
:defer t
:mode ("/go\\.mod\\'" . go-mod-ts-mode-maybe)
:init
(set-tree-sitter! 'go-mode 'go-ts-mode
'((go :url "https://github.com/tree-sitter/tree-sitter-go"
:commit "12fe553fdaaa7449f764bc876fd777704d4fb752")
(gomod :url "https://github.com/camdencheek/tree-sitter-go-mod"
:commit "3b01edce2b9ea6766ca19328d1850e456fde3103")
(gowork :url "https://github.com/omertuc/tree-sitter-go-work"
:commit "949a8a470559543857a62102c84700d291fc984c")))
:commit "12fe553fdaaa7449f764bc876fd777704d4fb752")))
(set-tree-sitter! nil 'go-mod-ts-mode
'((gomod :url "https://github.com/camdencheek/tree-sitter-go-mod"
:commit "3b01edce2b9ea6766ca19328d1850e456fde3103")))
(when (fboundp 'go-work-ts-mode) ; 30.1+ only
(add-to-list 'auto-mode-alist '("/go\\.work\\'" . go-work-ts-mode-maybe))
(set-tree-sitter! nil 'go-work-ts-mode
'((gowork :url "https://github.com/omertuc/tree-sitter-go-work"
:commit "949a8a470559543857a62102c84700d291fc984c"))))
:config
(+go-common-config 'go-ts-mode))