]> 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)
committerDmitry Gutov <dmitry@gutov.dev>
Sun, 3 Dec 2023 14:12:21 +0000 (16:12 +0200)
* 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 18951a10c5586cebd295a35f8d5514e0b0a313bd..8127aa956f4b0bf1b509610b81749eb90fe093c3 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)