emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/php-mode 6abc9964d9 1/4: Add PHPStan and Psalm type names


From: ELPA Syncer
Subject: [nongnu] elpa/php-mode 6abc9964d9 1/4: Add PHPStan and Psalm type names to php-phpdoc-type-keywords
Date: Thu, 27 Oct 2022 11:59:33 -0400 (EDT)

branch: elpa/php-mode
commit 6abc9964d9611c557d81c0b34733a22096523ed7
Author: USAMI Kenta <tadsan@zonu.me>
Commit: USAMI Kenta <tadsan@zonu.me>

    Add PHPStan and Psalm type names to php-phpdoc-type-keywords
---
 lisp/php-mode.el                             | 10 +++++++++-
 tests/lang/doc-comment/return-type.php.faces | 20 +++++++++++++++-----
 2 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/lisp/php-mode.el b/lisp/php-mode.el
index 241e2c9697..82ee54dbcb 100644
--- a/lisp/php-mode.el
+++ b/lisp/php-mode.el
@@ -1279,7 +1279,15 @@ for \\[find-tag] (which see)."
   (list "string" "integer" "int" "boolean" "bool" "float"
         "double" "object" "mixed" "array" "resource"
         "void" "null" "false" "true" "self" "static"
-        "callable" "iterable" "number"))
+        "callable" "iterable" "number"
+        ;; PHPStan and Psalm types
+        "array-key" "associative-array" "callable-array" "callable-object"
+        "callable-string" "class-string" "empty" "enum-string" "list"
+        "literal-string" "negative-int" "non-positive-int" "non-negative-int"
+        "never" "never-return" "never-returns" "no-return" "non-empty-array"
+        "non-empty-list" "non-empty-string" "non-falsy-string"
+        "numeric" "numeric-string" "positive-int" "scalar"
+        "trait-string" "truthy-string"))
 
 (defconst php-phpdoc-type-tags
   (list "package" "param" "property" "property-read" "property-write"
diff --git a/tests/lang/doc-comment/return-type.php.faces 
b/tests/lang/doc-comment/return-type.php.faces
index 13d08f2fc8..7bc8a8ec17 100644
--- a/tests/lang/doc-comment/return-type.php.faces
+++ b/tests/lang/doc-comment/return-type.php.faces
@@ -32,7 +32,9 @@
  (" " . font-lock-doc-face)
  ("int" font-lock-type-face php-string font-lock-doc-face)
  ("[]" php-string font-lock-doc-face)
- (" A list of " . font-lock-doc-face)
+ (" A " . font-lock-doc-face)
+ ("list" font-lock-type-face font-lock-doc-face)
+ (" of " . font-lock-doc-face)
  ("integer" font-lock-type-face font-lock-doc-face)
  (" values */" . font-lock-doc-face)
  ("\n\n\n")
@@ -59,7 +61,9 @@
  ("@return" php-doc-annotation-tag font-lock-doc-face)
  (" " . font-lock-doc-face)
  ("DateTime[]" php-string font-lock-doc-face)
- (" A list of DateTime " . font-lock-doc-face)
+ (" A " . font-lock-doc-face)
+ ("list" font-lock-type-face font-lock-doc-face)
+ (" of DateTime " . font-lock-doc-face)
  ("object" font-lock-type-face font-lock-doc-face)
  (" values */" . font-lock-doc-face)
  ("\n\n\n")
@@ -86,7 +90,9 @@
  ("@return" php-doc-annotation-tag font-lock-doc-face)
  (" " . font-lock-doc-face)
  ("stdClass[]" php-string font-lock-doc-face)
- (" A list of stdClass " . font-lock-doc-face)
+ (" A " . font-lock-doc-face)
+ ("list" font-lock-type-face font-lock-doc-face)
+ (" of stdClass " . font-lock-doc-face)
  ("object" font-lock-type-face font-lock-doc-face)
  (" values */" . font-lock-doc-face)
  ("\n\n")
@@ -113,7 +119,9 @@
  ("@return" php-doc-annotation-tag font-lock-doc-face)
  (" " . font-lock-doc-face)
  ("\\App\\User[]" php-string font-lock-doc-face)
- (" A list of \\App\\User " . font-lock-doc-face)
+ (" A " . font-lock-doc-face)
+ ("list" font-lock-type-face font-lock-doc-face)
+ (" of \\App\\User " . font-lock-doc-face)
  ("object" font-lock-type-face font-lock-doc-face)
  (" values */" . font-lock-doc-face)
  ("\n\n")
@@ -138,7 +146,9 @@
  ("int" font-lock-type-face php-string font-lock-doc-face)
  ("[]|" php-string font-lock-doc-face)
  ("string" font-lock-type-face php-string font-lock-doc-face)
- ("  Multiple types by list of " . font-lock-doc-face)
+ ("  Multiple types by " . font-lock-doc-face)
+ ("list" font-lock-type-face font-lock-doc-face)
+ (" of " . font-lock-doc-face)
  ("int" font-lock-type-face font-lock-doc-face)
  (" and " . font-lock-doc-face)
  ("string" font-lock-type-face font-lock-doc-face)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]