]> git.eshelyaron.com Git - emacs.git/commitdiff
Use c-ts-common's comment setup in go-ts-mode (bug#75978)
authorYuan Fu <casouri@gmail.com>
Wed, 12 Feb 2025 04:38:00 +0000 (20:38 -0800)
committerEshel Yaron <me@eshelyaron.com>
Sat, 15 Feb 2025 19:29:31 +0000 (20:29 +0100)
c-ts-common-comment-setup sets up fill-paragraph-function, which
enables filling for comments.

* lisp/progmodes/go-ts-mode.el (go-ts-mode):
(go-mod-ts-mode): Use c-ts-common-comment-setup.

(cherry picked from commit 19314257485e88a82b128fe39c60ffd08862da58)

lisp/progmodes/go-ts-mode.el

index 469df9904c431eee4ca77ae0926cb93ebf11a6bb..0d1265309e8d30b4925c0d805c0cb6dc99ab28d0 100644 (file)
@@ -42,6 +42,7 @@
 ;;; Code:
 
 (require 'treesit)
+(require 'c-ts-common)
 (eval-when-compile (require 'rx))
 (treesit-declare-unavailable-functions)
 
     (setq treesit-primary-parser (treesit-parser-create 'go))
 
     ;; Comments.
-    (setq-local comment-start "// ")
-    (setq-local comment-end "")
-    (setq-local comment-start-skip (rx "//" (* (syntax whitespace))))
+    (c-ts-common-comment-setup)
 
     ;; Navigation.
     (setq-local treesit-defun-type-regexp
@@ -564,9 +563,7 @@ what the parent of the node would be if it were a node."
     (setq treesit-primary-parser (treesit-parser-create 'gomod))
 
     ;; Comments.
-    (setq-local comment-start "// ")
-    (setq-local comment-end "")
-    (setq-local comment-start-skip (rx "//" (* (syntax whitespace))))
+    (c-ts-common-comment-setup)
 
     ;; Indent.
     (setq-local indent-tabs-mode t