[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 2afb7dc87a 002/212: Generating basic imenu-in
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode 2afb7dc87a 002/212: Generating basic imenu-index via parser SDT |
Date: |
Wed, 26 Jan 2022 01:50:04 -0500 (EST) |
branch: externals/phps-mode
commit 2afb7dc87a47836edb5bb34c022c32aafc2735e8
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Generating basic imenu-index via parser SDT
---
test/phps-mode-test-parser.el | 37 +++++++++++++++++++++++++++++++++----
1 file changed, 33 insertions(+), 4 deletions(-)
diff --git a/test/phps-mode-test-parser.el b/test/phps-mode-test-parser.el
index 7fcc2afe60..827ed3497d 100644
--- a/test/phps-mode-test-parser.el
+++ b/test/phps-mode-test-parser.el
@@ -464,15 +464,44 @@
(message "\nAST:\n%S\n" ast)
(let ((imenu-index))
- ;; TODO Build imenu-index here
(dolist (item ast)
- )
+ (let ((children (plist-get item 'children))
+ (parent))
+ (if children
+ (progn
+ (dolist (child children)
+ (let ((grandchildren (plist-get child 'children))
+ (subparent))
+ (if grandchildren
+ (progn
+ (dolist (grandchild grandchildren)
+ (push
+ `(,(plist-get grandchild 'name) .
,(plist-get grandchild 'start))
+ subparent))
+ (push
+ (append
+ (list (plist-get child 'name))
+ (reverse subparent))
+ parent))
+ (push
+ `(,(plist-get child 'name) . ,(plist-get child
'start))
+ parent)))
+ )
+ (push
+ (append
+ (list (plist-get item 'name))
+ (reverse parent))
+ imenu-index))
+ (push
+ `(,(plist-get item 'name) . ,(plist-get item 'start))
+ imenu-index))))
+
+ (message "imenu-index:\n%S\n" imenu-index)
(should
(equal
imenu-index
- '(("MyNamespace" ("MyClass" ("__construct" . 92) ("myFunction1" .
193) ("myFunction2" . 365) ("myFunction3" . 445) ("myFunction4" . 515))))))
- ;; TODO Test bookkeeping here
+ '(("MyNamespace" ("aFunction" . 53) ("MyClass" ("__construct" .
178) ("myFunction1" . 279) ("myFunction2" . 451) ("myFunction3" . 531)
("myFunction4" . 601))))))
)))))
(message "\n-- Ran tests for parser translation. --"))
- [elpa] externals/phps-mode 6fac0d5585 102/212: Passed indent test for heredoc string, (continued)
- [elpa] externals/phps-mode 6fac0d5585 102/212: Passed indent test for heredoc string, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 1af63142f3 127/212: Fixed incremental issue with new SDT based bookkeeping, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 3565c7efb3 125/212: Fixed byte-compilation warnings for indent file, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode a8097b5b5e 147/212: Improved indentation on line after equal operator in if condition list, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode dece7f242e 160/212: Added more failing indentation tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode a530988fe0 134/212: Added more failing indent tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 8c1f529f87 145/212: Passing indent for line after ending of statement / expression with trailing closing bracket, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode d7aa22d251 146/212: Added two new failing tests for indentation, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode c453932f32 139/212: Added TODO item, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 8374026917 166/212: Improved indentation on lines starting with a closing square bracket, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 2afb7dc87a 002/212: Generating basic imenu-index via parser SDT,
Christian Johansson <=
- [elpa] externals/phps-mode 41b1566c40 010/212: Imenu generation via parser SDT passing more tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 8f9870fb9b 013/212: Parser SDT does not use global variables, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 4753734b0a 006/212: Moved syntax coloring to separate file, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode d037aa09bc 023/212: Added bookkeeping via parser SDT foreach ($x as $y) {}, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 3d54b6ff01 022/212: Passed another test for bookkeeping generated via parser SDT, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 442ad93cb2 018/212: Fix for function parameter formatting in AST, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 2a4d5dea37 019/212: Passed bookkeeping of function arguments, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode c29e35fea2 021/212: More work on bookkeeping, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 0daaa97f8d 025/212: SDT for for() loop started, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode fa3681141b 027/212: Passed test for bookkeeping of conditional assignment via parser SDT, Christian Johansson, 2022/01/26