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)
committerYuan Fu <casouri@gmail.com>
Wed, 12 Feb 2025 04:39:33 +0000 (20:39 -0800)
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.

lisp/progmodes/go-ts-mode.el

index cdd6e427db7fa780915c38fd07f60693611ecc0e..5110ab890f3dc06965f64f3bca9c1a218819b0f2 100644 (file)
@@ -28,6 +28,7 @@
 ;;; Code:
 
 (require 'treesit)
+(require 'c-ts-common)
 (eval-when-compile (require 'rx))
 
 (declare-function treesit-parser-create "treesit.c")
     (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
@@ -458,9 +457,7 @@ what the parent of the node would be if it were a node."
     (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