|
15 | 15 | (defconst php-mode-version-number "1.18.4" |
16 | 16 | "PHP Mode version number.") |
17 | 17 |
|
18 | | -(defconst php-mode-modified "2018-01-23" |
| 18 | +(defconst php-mode-modified "2018-01-29" |
19 | 19 | "PHP Mode build date.") |
20 | 20 |
|
21 | 21 | ;; This file is free software; you can redistribute it and/or |
|
81 | 81 | (require 'flymake) |
82 | 82 | (require 'etags) |
83 | 83 | (require 'speedbar) |
| 84 | +(require 'imenu) |
| 85 | +(require 'semantic/imenu) |
84 | 86 |
|
85 | 87 | (require 'cl-lib) |
| 88 | +(require 'mode-local) |
86 | 89 |
|
87 | 90 | (eval-when-compile |
88 | 91 | (require 'regexp-opt) |
@@ -259,6 +262,16 @@ can be used to match against definitions for that classlike." |
259 | 262 | "^\\s-*function\\s-+\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*(" 1)) |
260 | 263 | "Imenu generic expression for PHP Mode. See `imenu-generic-expression'.") |
261 | 264 |
|
| 265 | +(defcustom php-do-not-use-semantic-imenu nil |
| 266 | + "Customize `imenu-create-index-function' for `php-mode'. |
| 267 | +
|
| 268 | +If using `semantic-mode' `imenu-create-index-function' will be |
| 269 | +set to `semantic-create-imenu-index' due to `c-mode' being its |
| 270 | +parent. Set this variable to t if you want to use |
| 271 | +`imenu-default-create-index-function' even with `semantic-mode' |
| 272 | +enabled." |
| 273 | + :type 'boolean) |
| 274 | + |
262 | 275 | (defcustom php-site-url "http://php.net/" |
263 | 276 | "Default PHP.net site URL. |
264 | 277 |
|
@@ -1218,6 +1231,12 @@ After setting the stylevars run hooks according to STYLENAME |
1218 | 1231 | (save-excursion |
1219 | 1232 | (php-syntax-propertize-function (point-min) (point-max)))))) |
1220 | 1233 |
|
| 1234 | +(defvar-mode-local php-mode imenu-create-index-function |
| 1235 | + (if php-do-not-use-semantic-imenu |
| 1236 | + #'imenu-default-create-index-function |
| 1237 | + #'semantic-create-imenu-index) |
| 1238 | + "Imenu index function for PHP.") |
| 1239 | + |
1221 | 1240 |
|
1222 | 1241 | ;; Define function name completion function |
1223 | 1242 | (defvar php-completion-table nil |
@@ -1542,7 +1561,7 @@ a completion list." |
1542 | 1561 | ;; - when used as a type hint |
1543 | 1562 | ;; - when used as a return type |
1544 | 1563 | ("(\\(array\\))" 1 font-lock-type-face) |
1545 | | - ("\\b\\(array\\)\\s-+\\$" 1 font-lock-type-face) |
| 1564 | + ("\\b\\(array\\)\\s-+&?\\$" 1 font-lock-type-face) |
1546 | 1565 | (")\\s-*:\\s-*\\??\\(array\\)\\b" 1 font-lock-type-face) |
1547 | 1566 |
|
1548 | 1567 | ;; namespaces |
|
0 commit comments