[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode b7d5d7823c 118/135: Starting on sorting imenu
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode b7d5d7823c 118/135: Starting on sorting imenu |
Date: |
Sun, 29 Jan 2023 03:11:10 -0500 (EST) |
branch: externals/phps-mode
commit b7d5d7823c8f4219c4c79ef9e198f9ed1a9403f4
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Starting on sorting imenu
---
phps-mode-ast.el | 7 ++++++-
phps-mode-parser-sdt.el | 5 +++++
test/phps-mode-test-ast.el | 2 +-
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/phps-mode-ast.el b/phps-mode-ast.el
index a9a16bfef7..a6d9994243 100644
--- a/phps-mode-ast.el
+++ b/phps-mode-ast.el
@@ -93,7 +93,12 @@
`(,k3 . ,v3)
v2-list))
v2)
- ;; TODO sort v2-list here
+ (setq
+ v2-list
+ (sort
+ v2-list
+ (lambda (a b)
+ (< (cdr a) (cdr b)))))
(push
`(,k2 ,v2-list)
v-list))
diff --git a/phps-mode-parser-sdt.el b/phps-mode-parser-sdt.el
index 079d7a89ab..2a471daf99 100644
--- a/phps-mode-parser-sdt.el
+++ b/phps-mode-parser-sdt.el
@@ -1162,6 +1162,11 @@
(setq symbol-interface (car (nth 7 (nth 1 symbol-uri-object)))))
(when (nth 9 (nth 1 symbol-uri-object))
(setq symbol-function (car (nth 9 (nth 1 symbol-uri-object)))))
+ (message "symbol-namespace: %S" symbol-namespace)
+ (message "symbol-class: %S" symbol-class)
+ (message "symbol-trait: %S" symbol-trait)
+ (message "symbol-interface: %S" symbol-interface)
+ (message "symbol-function: %S" symbol-function)
;; Place symbol in imenu if not there already
(cond
diff --git a/test/phps-mode-test-ast.el b/test/phps-mode-test-ast.el
index 43b5f92ca3..2d7d9ca4c4 100644
--- a/test/phps-mode-test-ast.el
+++ b/test/phps-mode-test-ast.el
@@ -151,7 +151,7 @@
"<?php\n\n$var2 = 4;\n\nfunction myFunction($var)\n{\n $var3 = 3;\n
if ($var) {\n echo 'Hit';\n }\n if ($var2) {\n echo
'Miss';\n }\n if ($var3) {\n echo 'Hit';\n }\n}\n\nfunction
myFunction2($abc)\n{\n if ($var) {\n echo 'Miss';\n }\n if
($abc) {\n echo 'Hit';\n }\n}\n\nif ($var) {\n echo 'Miss';\n}\nif
($var2) {\n echo 'Hit';\n}"
"Bookkeeping in function level with variable assignments"
'(((8 13) 1) ((40 44) 3) ((52 57) 2) ((71 75) 3) ((113 118) 0) ((157 162)
2) ((216 220) 4) ((232 236) 0) ((275 279) 4) ((316 320) 0) ((347 352) 1))
- '(("id $var2" . 8) ("function myFunction" (("Declaration" . 29) ("id $var"
. 40) ("id $var3" . 52)) ("function myFunction2" . (("Declaration" . 204) ("id
$abc" . 216))))))
+ '(("id $var2" . 8) ("function myFunction" ((declaration . 29) ("id $var" .
40) ("id $var3" . 52)) ("function myFunction2" . ((declaration . 204) ("id
$abc" . 216))))))
(phps-mode-test-ast--should-bookkeep
"<?php\n\n// Super-globals\n\nif ($_GET) {\n echo 'Hit';\n}\nif ($_POST)
{\n echo 'Hit';\n}\nif ($_COOKIE) {\n echo 'Hit';\n}\nif ($_SESSION) {\n
echo 'Hit';\n}\nif ($_REQUEST) {\n echo 'Hit';\n}\nif ($GLOBALS) {\n
echo 'Hit';\n}\nif ($_SERVER) {\n echo 'Hit';\n}\nif ($_FILES) {\n echo
'Hit';\n}\nif ($_ENV) {\n echo 'Hit';\n}\nif ($argc) {\n echo
'Hit';\n}\nif ($argv) {\n echo 'Hit';\n}\nif ($http_​response_​header) {\n
echo 'Hit';\n}"
- [elpa] externals/phps-mode 9c43bc30c4 103/135: Removed old bookkeeping and imenu and integrated new via SDT, (continued)
- [elpa] externals/phps-mode 9c43bc30c4 103/135: Removed old bookkeeping and imenu and integrated new via SDT, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode a447ae69ba 106/135: Starting on generating imenu index for namespaces, classes, methods, traits, interfaces via SDT, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 16a63da318 113/135: More TODO items for bookkeeping, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 807c834649 116/135: More work on imenu generation, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode a84bfdccd3 120/135: More fighting the AST, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 23ba458f20 133/135: Updated version and date for 0.4.31, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode d5bdadc6fc 135/135: Improved installation documentation, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 8259e390b4 092/135: Added TODO item, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 9f21c86dd1 108/135: SDT integration now passing byte-compilation, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode ddc5b5aa2a 112/135: Using sorted bookkeeping for test, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode b7d5d7823c 118/135: Starting on sorting imenu,
Christian Johansson <=
- [elpa] externals/phps-mode be00689e6f 119/135: Fixed sorting of imenu, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 330e6fd6cc 128/135: Superglobals and $this not included in imenu index, Christian Johansson, 2023/01/29