aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorYuan Fu2022-12-02 17:03:21 -0800
committerYuan Fu2022-12-03 14:49:38 -0800
commit96af584af6c8ea50f9cf871db9ffca91040fb85d (patch)
tree71e85c4b991520c32ab3aa2d66ead1d0ebd913d8 /lisp
parent520a4e12f8e6e42d0c66cc6b3cf3be05c411fe6f (diff)
downloademacs-96af584af6c8ea50f9cf871db9ffca91040fb85d.tar.gz
emacs-96af584af6c8ea50f9cf871db9ffca91040fb85d.zip
Fix comment-start-skip in tree-sitter modes (bug#59690)
* lisp/progmodes/c-ts-mode.el (c-ts-mode) (c++-ts-mode) * lisp/progmodes/csharp-mode.el (csharp-ts-mode) * lisp/progmodes/java-ts-mode.el (java-ts-mode) * lisp/progmodes/js.el (js-ts-mode) * lisp/progmodes/typescript-ts-mode.el (tsx-ts-mode): Remove the group from the regexp.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/progmodes/c-ts-mode.el6
-rw-r--r--lisp/progmodes/csharp-mode.el3
-rw-r--r--lisp/progmodes/java-ts-mode.el3
-rw-r--r--lisp/progmodes/js.el3
-rw-r--r--lisp/progmodes/typescript-ts-mode.el4
5 files changed, 13 insertions, 6 deletions
diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
index fcabb5beac8..a8189a0f3da 100644
--- a/lisp/progmodes/c-ts-mode.el
+++ b/lisp/progmodes/c-ts-mode.el
@@ -566,7 +566,8 @@ the subtrees."
566 ;; Comments. 566 ;; Comments.
567 (setq-local comment-start "/* ") 567 (setq-local comment-start "/* ")
568 (setq-local comment-end " */") 568 (setq-local comment-end " */")
569 (setq-local comment-start-skip (rx (group "/" (or (+ "/") (+ "*"))) 569 (setq-local comment-start-skip (rx (or (seq "/" (+ "/"))
570 (seq "/" (+ "*")))
570 (* (syntax whitespace)))) 571 (* (syntax whitespace))))
571 (setq-local comment-end-skip 572 (setq-local comment-end-skip
572 (rx (* (syntax whitespace)) 573 (rx (* (syntax whitespace))
@@ -596,7 +597,8 @@ the subtrees."
596 ;; Comments. 597 ;; Comments.
597 (setq-local comment-start "// ") 598 (setq-local comment-start "// ")
598 (setq-local comment-end "") 599 (setq-local comment-end "")
599 (setq-local comment-start-skip (rx (group "/" (or (+ "/") (+ "*"))) 600 (setq-local comment-start-skip (rx (or (seq "/" (+ "/"))
601 (seq "/" (+ "*")))
600 (* (syntax whitespace)))) 602 (* (syntax whitespace))))
601 (setq-local comment-end-skip 603 (setq-local comment-end-skip
602 (rx (* (syntax whitespace)) 604 (rx (* (syntax whitespace))
diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el
index 3da3079f089..054dabfed07 100644
--- a/lisp/progmodes/csharp-mode.el
+++ b/lisp/progmodes/csharp-mode.el
@@ -900,7 +900,8 @@ Key bindings:
900 ;; Comments. 900 ;; Comments.
901 (setq-local comment-start "// ") 901 (setq-local comment-start "// ")
902 (setq-local comment-end "") 902 (setq-local comment-end "")
903 (setq-local comment-start-skip (rx (group "/" (or (+ "/") (+ "*"))) 903 (setq-local comment-start-skip (rx (or (seq "/" (+ "/"))
904 (seq "/" (+ "*")))
904 (* (syntax whitespace)))) 905 (* (syntax whitespace))))
905 (setq-local comment-end-skip 906 (setq-local comment-end-skip
906 (rx (* (syntax whitespace)) 907 (rx (* (syntax whitespace))
diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el
index cf2482bb6ee..2c42505ac94 100644
--- a/lisp/progmodes/java-ts-mode.el
+++ b/lisp/progmodes/java-ts-mode.el
@@ -301,7 +301,8 @@ the subtrees."
301 ;; Comments. 301 ;; Comments.
302 (setq-local comment-start "// ") 302 (setq-local comment-start "// ")
303 (setq-local comment-end "") 303 (setq-local comment-end "")
304 (setq-local comment-start-skip (rx (group "/" (or (+ "/") (+ "*"))) 304 (setq-local comment-start-skip (rx (or (seq "/" (+ "/"))
305 (seq "/" (+ "*")))
305 (* (syntax whitespace)))) 306 (* (syntax whitespace))))
306 (setq-local comment-end-skip 307 (setq-local comment-end-skip
307 (rx (* (syntax whitespace)) 308 (rx (* (syntax whitespace))
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index ad1fe62d429..389096147ac 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -3849,7 +3849,8 @@ Currently there are `js-mode' and `js-ts-mode'."
3849 ;; Comment. 3849 ;; Comment.
3850 (setq-local comment-start "// ") 3850 (setq-local comment-start "// ")
3851 (setq-local comment-end "") 3851 (setq-local comment-end "")
3852 (setq-local comment-start-skip (rx (group "/" (or (+ "/") (+ "*"))) 3852 (setq-local comment-start-skip (rx (or (seq "/" (+ "/"))
3853 (seq "/" (+ "*")))
3853 (* (syntax whitespace)))) 3854 (* (syntax whitespace))))
3854 (setq-local comment-end-skip 3855 (setq-local comment-end-skip
3855 (rx (* (syntax whitespace)) 3856 (rx (* (syntax whitespace))
diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el
index e09bacdcb1b..48ac1169fe8 100644
--- a/lisp/progmodes/typescript-ts-mode.el
+++ b/lisp/progmodes/typescript-ts-mode.el
@@ -362,7 +362,9 @@ Argument LANGUAGE is either `typescript' or `tsx'."
362 ;; Comments. 362 ;; Comments.
363 (setq-local comment-start "// ") 363 (setq-local comment-start "// ")
364 (setq-local comment-end "") 364 (setq-local comment-end "")
365 (setq-local comment-start-skip "\\(?://+\\|/\\*+\\)\\s *") 365 (setq-local comment-start-skip (rx (or (seq "/" (+ "/"))
366 (seq "/" (+ "*")))
367 (* (syntax whitespace))))
366 (setq-local comment-end-skip 368 (setq-local comment-end-skip
367 (rx (* (syntax whitespace)) 369 (rx (* (syntax whitespace))
368 (group (or (syntax comment-end) 370 (group (or (syntax comment-end)