]> git.eshelyaron.com Git - emacs.git/commitdiff
rust-ts-mode--comment-docstring: Handle block doc comments
authorChristophe Troestler <Christophe.Troestler@umons.ac.be>
Sat, 2 Dec 2023 20:51:15 +0000 (21:51 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sat, 9 Dec 2023 19:05:31 +0000 (20:05 +0100)
* lisp/progmodes/rust-ts-mode.el
(rust-ts-mode--comment-docstring): Handle block doc comments.
Inhibit match-data modification.

lisp/progmodes/rust-ts-mode.el

index 1a1f6ace047d062b95d61b5662c180f4e2e49b84..c4efea0e7d2b159690eecaf43eb6c1cc5a81d0d2 100644 (file)
   (let* ((beg (treesit-node-start node))
          (face (save-excursion
                  (goto-char beg)
-                 (if (looking-at "//\\(?:/\\|!\\)")
+                 (if (looking-at "/\\(?:/\\(?:/[^/]\\|!\\)\\|*\\(?:*[^*/]\\|!\\)\\)" t)
                      'font-lock-doc-face
                    'font-lock-comment-face))))
     (treesit-fontify-with-override beg (treesit-node-end node)