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)) (+go-common-config 'go-mode))
(use-package! go-ts-mode (use-package! go-ts-mode ; 29.1+ only
:when (modulep! +tree-sitter) :when (modulep! +tree-sitter)
:when (fboundp 'go-ts-mode) ; 31.1+ only :mode ("/go\\.mod\\'" . go-mod-ts-mode-maybe)
:defer t
:init :init
(set-tree-sitter! 'go-mode 'go-ts-mode (set-tree-sitter! 'go-mode 'go-ts-mode
'((go :url "https://github.com/tree-sitter/tree-sitter-go" '((go :url "https://github.com/tree-sitter/tree-sitter-go"
:commit "12fe553fdaaa7449f764bc876fd777704d4fb752") :commit "12fe553fdaaa7449f764bc876fd777704d4fb752")))
(gomod :url "https://github.com/camdencheek/tree-sitter-go-mod" (set-tree-sitter! nil 'go-mod-ts-mode
:commit "3b01edce2b9ea6766ca19328d1850e456fde3103") '((gomod :url "https://github.com/camdencheek/tree-sitter-go-mod"
(gowork :url "https://github.com/omertuc/tree-sitter-go-work" :commit "3b01edce2b9ea6766ca19328d1850e456fde3103")))
:commit "949a8a470559543857a62102c84700d291fc984c"))) (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 :config
(+go-common-config 'go-ts-mode)) (+go-common-config 'go-ts-mode))