branch: elpa/php-mode commit e906093949d613d2771edf8e50fc48ccc481f539 Merge: 34462fc138 532b73eb21 Author: USAMI Kenta <tad...@pixiv.com> Commit: GitHub <nore...@github.com>
Merge pull request #757 from piotrkwiecinski/consult-imenu add support for consult imenu --- AUTHORS.md | 1 + lisp/php-mode.el | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/AUTHORS.md b/AUTHORS.md index ab8da75ca9..9b5ab92087 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -83,6 +83,7 @@ Names Sorted Alphabetically: - Olaf The Viking - Peter Oliver - Philippe Ivaldi +- Piotr Kwiecinski - Rex McMaster - Roland - Rosenfeld diff --git a/lisp/php-mode.el b/lisp/php-mode.el index dda4c89219..dd57690bbf 100644 --- a/lisp/php-mode.el +++ b/lisp/php-mode.el @@ -73,6 +73,7 @@ (require 'custom) (require 'speedbar) (require 'imenu) +(require 'consult-imenu nil t) (require 'package) (require 'nadvice) (require 'mode-local) @@ -1267,6 +1268,16 @@ After setting the stylevars run hook `php-mode-STYLENAME-hook'." #'semantic-create-imenu-index) "Imenu index function for PHP.") +(when (bound-and-true-p consult-imenu-config) + (add-to-list 'consult-imenu-config '(php-mode :toplevel "Namespace" + :types ((?n "Namespace" font-lock-function-name-face) + (?p "Properties" font-lock-type-face) + (?o "Constants" font-lock-type-face) + (?c "Classes" font-lock-type-face) + (?f "Functions" font-lock-function-name-face) + (?i "Imports" font-lock-type-face) + (?m "Methods" font-lock-function-name-face))))) + (autoload 'php-local-manual-complete-function "php-local-manual") (defun php-complete-function ()