Skip to content

Commit 42da974

Browse files
committed
scala-ts-mode properly recognizes line comments as comment syntax
These syntax-table entries are the same as java-ts-mode's. This lets Emacs recognize "// line comment" as proper comment syntax, rather than just unformatted text. The behavior of "/* block comments */" is unchanged.
1 parent 831f64a commit 42da974

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

scala-ts-mode.el

+3-4
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,9 @@
6868
(modify-syntax-entry ?\\ "\\" table) ; Escape seq start
6969
(modify-syntax-entry ?\" "\"" table) ; String start
7070
(modify-syntax-entry ?' "/" table) ; Char start
71-
(modify-syntax-entry ?/ "< 12" table) ; Comment seq a, first two char are /
72-
(modify-syntax-entry ?\n ">" table) ; Comment seq a, ends with a newline
73-
(modify-syntax-entry ?/ ". 14b" table) ; Comment seq b, starts and ends with /
74-
(modify-syntax-entry ?* ". 23b" table) ; Comment seq b, second start and first end char is *
71+
(modify-syntax-entry ?/ ". 124b" table) ; Line/block comment // or /* */
72+
(modify-syntax-entry ?* ". 23" table) ; Block comment /* */
73+
(modify-syntax-entry ?\n "> b" table) ; Comment ends with newline
7574
table)
7675
"Syntax table for `scala-ts-mode'.")
7776

0 commit comments

Comments
 (0)