branch: externals/phps-mode
commit 16c15c9ef4fe105b06e43733d1f34d0edb298abb
Author: Christian Johansson <[email protected]>
Commit: Christian Johansson <[email protected]>

    Added type check to imenu-index generation
---
 test/phps-mode-test-parser.el | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/test/phps-mode-test-parser.el b/test/phps-mode-test-parser.el
index 0ebc4ccaa7..62e64bf11b 100644
--- a/test/phps-mode-test-parser.el
+++ b/test/phps-mode-test-parser.el
@@ -463,16 +463,25 @@
             ast))
 
          (message "\nAST:\n%S\n" ast)
+
          (let ((imenu-index))
            (dolist (item ast)
              (let ((children (plist-get item 'children))
+                   (item-type (plist-get item 'type))
                    (parent))
-               (if children
+               (if (and
+                    (or
+                     (equal item-type 'namespace)
+                     (equal item-type 'class))
+                    children)
                    (progn
                      (dolist (child children)
                        (let ((grandchildren (plist-get child 'children))
+                             (child-type (plist-get child 'type))
                              (subparent))
-                         (if grandchildren
+                         (if (and
+                              (equal child-type 'class)
+                              grandchildren)
                              (progn
                                (dolist (grandchild grandchildren)
                                  (push

Reply via email to