emacs-elpa-diffs
[Top][All Lists]
Advanced

[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}"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]