branch: elpa/php-mode commit b9d7f07b1a3824e117fd82370a41801399f4aae8 Author: USAMI Kenta <tad...@zonu.me> Commit: USAMI Kenta <tad...@zonu.me>
Addreadonly class modifier to imenu --- CHANGELOG.md | 9 ++++++++- lisp/php.el | 8 +++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1aa2e9cc6e..61154bc30e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,14 @@ All notable changes of the PHP Mode 1.19.1 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. -<!-- ## Unreleased --> +## Unreleased + +### Changed + + * Add `readonly` class modifier to [Imenu] ([#802]) + +[Imenu]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Imenu.html +[#802]: https://github.com/emacs-php/php-mode/pull/802 ## [1.27.0] - 2024-12-20 diff --git a/lisp/php.el b/lisp/php.el index 2e05d2a5f9..c3491fa9b5 100644 --- a/lisp/php.el +++ b/lisp/php.el @@ -325,12 +325,18 @@ can be used to match against definitions for that classlike." ;; First see if 'abstract' or 'final' appear, although really these ;; are not valid for all values of `type' that the function ;; accepts. - "^\\s-*\\(?:\\(?:abstract\\|final\\)\\s-+\\)?" + (eval-when-compile + (rx line-start + (* (syntax whitespace)) + (? (or "abstract" "final" "readonly") + (+ (syntax whitespace))))) ;; The classlike type type ;; Its name, which is the first captured group in the regexp. We ;; allow backslashes in the name to handle namespaces, but again ;; this is not necessarily correct for all values of `type'. + ;; (rx (+ (syntax whitespace)) + ;; (group (+ (or (syntax word) "\\" (syntax symbol))))) "\\s-+\\(\\(?:\\sw\\|\\\\\\|\\s_\\)+\\)"))) (defconst php-imenu-generic-expression-default