summaryrefslogtreecommitdiff
path: root/lisp/progmodes/ts-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/ts-mode.el')
-rw-r--r--lisp/progmodes/ts-mode.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/lisp/progmodes/ts-mode.el b/lisp/progmodes/ts-mode.el
index c826302c7ac..a6f8e0a65ee 100644
--- a/lisp/progmodes/ts-mode.el
+++ b/lisp/progmodes/ts-mode.el
@@ -61,6 +61,8 @@
((node-is ")") parent-bol 0)
((node-is "]") parent-bol 0)
((node-is ">") parent-bol 0)
+ ((and (parent-is "comment") comment-end) comment-start -1)
+ ((parent-is "comment") comment-start-skip 0)
((parent-is "ternary_expression") parent-bol ts-mode-indent-offset)
((parent-is "member_expression") parent-bol ts-mode-indent-offset)
((parent-is "named_imports") parent-bol ts-mode-indent-offset)
@@ -273,6 +275,8 @@
(setq-local comment-start "// ")
(setq-local comment-start-skip "\\(?://+\\|/\\*+\\)\\s *")
(setq-local comment-end "")
+ (setq-local treesit-comment-start (rx "/" (or (+ "/") (+ "*"))))
+ (setq-local treesit-comment-end (rx (+ (or "*")) "/"))
;; Electric
(setq-local electric-indent-chars