From 45d6713e0bb54da5a331f53a6a43c39410cf7c7e Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Mon, 26 Aug 2019 07:31:50 +0900 Subject: [PATCH 1/2] Highlight {@inheritdoc} notation --- php-mode.el | 2 +- tests/doc-comment/inheritdoc.php | 5 +++++ tests/doc-comment/inheritdoc.php.faces | 7 +++++++ tests/php-mode-test.el | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 tests/doc-comment/inheritdoc.php create mode 100644 tests/doc-comment/inheritdoc.php.faces diff --git a/php-mode.el b/php-mode.el index 364a4486..65beeb16 100644 --- a/php-mode.el +++ b/php-mode.el @@ -1436,7 +1436,7 @@ a completion list." "return" "throws" "var")) (defconst php-phpdoc-font-lock-doc-comments - `(("{@[-[:alpha:]]+\\s-\\([^}]*\\)}" ; "{@foo ...}" markup. + `(("{@[-[:alpha:]]+\\s-*\\([^}]*\\)}" ; "{@foo ...}" markup. (0 'php-doc-annotation-tag prepend nil) (1 'php-string prepend nil)) (,(rx (group "$") (group (in "A-Za-z_") (* (in "0-9A-Za-z_")))) diff --git a/tests/doc-comment/inheritdoc.php b/tests/doc-comment/inheritdoc.php new file mode 100644 index 00000000..e2000a82 --- /dev/null +++ b/tests/doc-comment/inheritdoc.php @@ -0,0 +1,5 @@ + Date: Mon, 26 Aug 2019 07:34:40 +0900 Subject: [PATCH 2/2] Move test return-type file to doc-comment directory --- .../return-type.php} | 0 .../return-type.php.faces} | 0 tests/php-mode-test.el | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) rename tests/{doc-comment-return-type.php => doc-comment/return-type.php} (100%) rename tests/{doc-comment-return-type.php.faces => doc-comment/return-type.php.faces} (100%) diff --git a/tests/doc-comment-return-type.php b/tests/doc-comment/return-type.php similarity index 100% rename from tests/doc-comment-return-type.php rename to tests/doc-comment/return-type.php diff --git a/tests/doc-comment-return-type.php.faces b/tests/doc-comment/return-type.php.faces similarity index 100% rename from tests/doc-comment-return-type.php.faces rename to tests/doc-comment/return-type.php.faces diff --git a/tests/php-mode-test.el b/tests/php-mode-test.el index 9f0ce51c..3027456d 100644 --- a/tests/php-mode-test.el +++ b/tests/php-mode-test.el @@ -672,7 +672,7 @@ Meant for `php-mode-test-issue-503'." :faces (cond ((eq emacs-major-version 24) ".24.faces") ((version<= "27" emacs-version) ".27.faces") (t t)))) - (with-php-mode-test ("doc-comment-return-type.php" :faces t)) + (with-php-mode-test ("doc-comment/return-type.php" :faces t)) (with-php-mode-test ("doc-comment/inheritdoc.php" :faces t)) (with-php-mode-test ("lang/types/cast.php" :faces t)) (with-php-mode-test ("lang/types/function.php" :faces t))