[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/php-mode 865bc847f8 06/12: Merge pull request #717 from em
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/php-mode 865bc847f8 06/12: Merge pull request #717 from emacs-php/refactor/phpdoc-type-variables |
Date: |
Thu, 3 Nov 2022 12:59:19 -0400 (EDT) |
branch: elpa/php-mode
commit 865bc847f8be1e0b3c9d50f737e817df61911975
Merge: fe8ab0903c 7853345918
Author: USAMI Kenta <tadsan@pixiv.com>
Commit: GitHub <noreply@github.com>
Merge pull request #717 from emacs-php/refactor/phpdoc-type-variables
Add PHPDoc types and rename variable name
---
CHANGELOG.md | 12 +++++++++++-
lisp/php-mode.el | 17 ++++++++++++-----
2 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index cd522ba1bd..1cccfd1309 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,13 +8,20 @@ All notable changes of the PHP Mode 1.19.1 release series are
documented in this
* **New feature: `php-complete`**
* Add `php-complete-complete-function` to autocomplete function names
([#708])
- * Supports PHPDoc tags and types for static analysis tools ([#710])
+ * Supports PHPDoc tags and types for static analysis tools ([#710], [#715],
[#716], [#717], thanks to [@takeokunn])
+ * Please refer to the article below
+ * PHPStan: [PHPDoc
Types](https://phpstan.org/writing-php-code/phpdoc-types)
+ * PHPStan: [PHPDocs
Basics](https://phpstan.org/writing-php-code/phpdocs-basics)
+ * Psalm: [Atomic Type
Reference](https://psalm.dev/docs/annotating_code/type_syntax/atomic_types/)
+ * Psalm: [Supported
Annotations](https://psalm.dev/docs/annotating_code/supported_annotations/)
+ * Psalm: [Template
Annotations](https://psalm.dev/docs/annotating_code/templated_annotations/)
### Changed
* Make continued expressions inside lists (arguments and arrays, etc.) have
the same indent width as outside the list ([#703])
* (internal) Improved readability of test failures about indentation ([#707])
* `php-doc-annotation-tag` inherits `font-lock-doc-markup-face` if defined in
Emacs 28 ([#711])
+ * Change `php-phpdoc-type-keywords` to `php-phpdoc-type-names` to avoid
confusion ([#717])
### Fixed
@@ -26,6 +33,9 @@ All notable changes of the PHP Mode 1.19.1 release series are
documented in this
[#708]: https://github.com/emacs-php/php-mode/pull/708
[#710]: https://github.com/emacs-php/php-mode/pull/710
[#711]: https://github.com/emacs-php/php-mode/pull/711
+[#715]: https://github.com/emacs-php/php-mode/pull/715
+[#716]: https://github.com/emacs-php/php-mode/pull/716
+[#717]: https://github.com/emacs-php/php-mode/pull/717
## [1.24.1] - 2022-10-08
diff --git a/lisp/php-mode.el b/lisp/php-mode.el
index 37f2ba602b..5e5b66e790 100644
--- a/lisp/php-mode.el
+++ b/lisp/php-mode.el
@@ -1275,7 +1275,7 @@ for \\[find-tag] (which see)."
(message "Unknown function: %s" tagname))))
;; Font Lock
-(defconst php-phpdoc-type-keywords
+(defconst php-phpdoc-type-names
(list "string" "integer" "int" "boolean" "bool" "float"
"double" "object" "mixed" "array" "resource"
"void" "null" "false" "true" "self" "static"
@@ -1287,11 +1287,18 @@ for \\[find-tag] (which see)."
"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" "key-of" "value-of"))
+ "trait-string" "truthy-string" "key-of" "value-of")
+ "A list of type and pseudotype names that can be used in PHPDoc.")
+
+(make-obsolete-variable 'php-phpdoc-type-keywords 'php-phpdoc-type-names
"1.24.2")
(defconst php-phpdoc-type-tags
(list "package" "param" "property" "property-read" "property-write"
- "return" "throws" "var" "self-out" "this-out" "param-out"))
+ "return" "throws" "var" "self-out" "this-out" "param-out"
+ "type" "extends" "require-extends" "implemtents" "require-implements"
+ "template" "template-covariant" "template-extends"
"template-implements"
+ "assert" "assert-if-true" "assert-if-false" "if-this-is")
+ "A list of tags specifying type names.")
(defconst php-phpdoc-font-lock-doc-comments
`(("{@[-[:alpha:]]+\\s-*\\([^}]*\\)}" ; "{@foo ...}" markup.
@@ -1301,11 +1308,11 @@ for \\[find-tag] (which see)."
(1 'php-doc-variable-sigil prepend nil)
(2 'php-variable-name prepend nil))
("\\(\\$\\)\\(this\\)\\>" (1 'php-doc-$this-sigil prepend nil) (2
'php-doc-$this prepend nil))
- (,(concat "\\s-@" (rx (? (or "phpstan" "psalm") "-")) (regexp-opt
php-phpdoc-type-tags) "\\s-+"
+ (,(concat "\\s-@" (rx (? (or "phan" "phpstan" "psalm") "-")) (regexp-opt
php-phpdoc-type-tags) "\\s-+"
"\\(" (rx (+ (? "?") (? "\\") (+ (in "0-9A-Z_a-z")) (? "[]") (?
"|"))) "\\)+")
1 'php-string prepend nil)
(,(concat "\\(?:|\\|\\?\\|\\s-\\)\\("
- (regexp-opt php-phpdoc-type-keywords 'words)
+ (regexp-opt php-phpdoc-type-names 'words)
"\\)")
1 font-lock-type-face prepend nil)
("https?://[^\n\t ]+"
- [nongnu] elpa/php-mode updated (fe8ab0903c -> f5c4016bb6), ELPA Syncer, 2022/11/03
- [nongnu] elpa/php-mode 44601ab2df 02/12: Add "phan" to type tag vendor prefix, ELPA Syncer, 2022/11/03
- [nongnu] elpa/php-mode 258d6c5460 04/12: Add Psalm template annotations to php-phpdoc-type-tags, ELPA Syncer, 2022/11/03
- [nongnu] elpa/php-mode 9603a4f54f 10/12: Revert string-trim-right, ELPA Syncer, 2022/11/03
- [nongnu] elpa/php-mode f5c4016bb6 12/12: Update AUTHORS, ELPA Syncer, 2022/11/03
- [nongnu] elpa/php-mode 0bbdc46e01 03/12: Add "type" to php-phpdoc-type-tags as "phpstan-type", ELPA Syncer, 2022/11/03
- [nongnu] elpa/php-mode 7853345918 05/12: Update CHANGELOG, ELPA Syncer, 2022/11/03
- [nongnu] elpa/php-mode 865bc847f8 06/12: Merge pull request #717 from emacs-php/refactor/phpdoc-type-variables,
ELPA Syncer <=
- [nongnu] elpa/php-mode 08ef915dc3 09/12: Revert "Use compat-string-trim-* functions for compatibility", ELPA Syncer, 2022/11/03
- [nongnu] elpa/php-mode b559c80a1e 11/12: Merge pull request #713 from emacs-php/feature/php-mode-version, ELPA Syncer, 2022/11/03
- [nongnu] elpa/php-mode cf10f7c217 08/12: Use compat-string-trim-* functions for compatibility, ELPA Syncer, 2022/11/03
- [nongnu] elpa/php-mode 08776c1b50 01/12: Changed variable name to php-phpdoc-type-names to avoid confusion, ELPA Syncer, 2022/11/03
- [nongnu] elpa/php-mode f35bf9a28c 07/12: Add php-mode-version-id and make obsolete php-mode-version-number, ELPA Syncer, 2022/11/03