Skip to content

Commit 45d6713

Browse files
committed
Highlight {@inheritdoc} notation
1 parent bfc5b7d commit 45d6713

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

Diff for: php-mode.el

+1-1
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,7 @@ a completion list."
14361436
"return" "throws" "var"))
14371437

14381438
(defconst php-phpdoc-font-lock-doc-comments
1439-
`(("{@[-[:alpha:]]+\\s-\\([^}]*\\)}" ; "{@foo ...}" markup.
1439+
`(("{@[-[:alpha:]]+\\s-*\\([^}]*\\)}" ; "{@foo ...}" markup.
14401440
(0 'php-doc-annotation-tag prepend nil)
14411441
(1 'php-string prepend nil))
14421442
(,(rx (group "$") (group (in "A-Za-z_") (* (in "0-9A-Za-z_"))))

Diff for: tests/doc-comment/inheritdoc.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
/**
4+
* {@inheritdoc}
5+
*/

Diff for: tests/doc-comment/inheritdoc.php.faces

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
;; -*- mode: emacs-lisp -*-
2+
(("<?php" . php-php-tag)
3+
("\n\n")
4+
("/**\n * " . font-lock-doc-face)
5+
("{@inheritdoc}" php-doc-annotation-tag font-lock-doc-face)
6+
("\n */" . font-lock-doc-face)
7+
("\n"))

Diff for: tests/php-mode-test.el

+1
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,7 @@ Meant for `php-mode-test-issue-503'."
673673
((version<= "27" emacs-version) ".27.faces")
674674
(t t))))
675675
(with-php-mode-test ("doc-comment-return-type.php" :faces t))
676+
(with-php-mode-test ("doc-comment/inheritdoc.php" :faces t))
676677
(with-php-mode-test ("lang/types/cast.php" :faces t))
677678
(with-php-mode-test ("lang/types/function.php" :faces t))
678679
(with-php-mode-test ("lang/types/keywords.php" :faces t))

0 commit comments

Comments
 (0)