From 86b6ba81acb551ba9bce8cb865d75db07ca99af6 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 31 Aug 2025 14:25:41 +0200 Subject: [PATCH] fix(go): go-{mod,work}-ts-mode --- modules/lang/go/config.el | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/modules/lang/go/config.el b/modules/lang/go/config.el index 387c1ee97..e6dde2ef4 100644 --- a/modules/lang/go/config.el +++ b/modules/lang/go/config.el @@ -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))