Skip to content

Commit b9d7f07

Browse files
committed
Addreadonly class modifier to imenu
1 parent 5b6cc1c commit b9d7f07

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

CHANGELOG.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22

33
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.
44

5-
<!-- ## Unreleased -->
5+
## Unreleased
6+
7+
### Changed
8+
9+
* Add `readonly` class modifier to [Imenu] ([#802])
10+
11+
[Imenu]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Imenu.html
12+
[#802]: https://github.com/emacs-php/php-mode/pull/802
613

714
## [1.27.0] - 2024-12-20
815

lisp/php.el

+7-1
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,18 @@ can be used to match against definitions for that classlike."
325325
;; First see if 'abstract' or 'final' appear, although really these
326326
;; are not valid for all values of `type' that the function
327327
;; accepts.
328-
"^\\s-*\\(?:\\(?:abstract\\|final\\)\\s-+\\)?"
328+
(eval-when-compile
329+
(rx line-start
330+
(* (syntax whitespace))
331+
(? (or "abstract" "final" "readonly")
332+
(+ (syntax whitespace)))))
329333
;; The classlike type
330334
type
331335
;; Its name, which is the first captured group in the regexp. We
332336
;; allow backslashes in the name to handle namespaces, but again
333337
;; this is not necessarily correct for all values of `type'.
338+
;; (rx (+ (syntax whitespace))
339+
;; (group (+ (or (syntax word) "\\" (syntax symbol)))))
334340
"\\s-+\\(\\(?:\\sw\\|\\\\\\|\\s_\\)+\\)")))
335341

336342
(defconst php-imenu-generic-expression-default

0 commit comments

Comments
 (0)