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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/phps-mode 96eeff74f8 130/135: Added more todo items for


From: Christian Johansson
Subject: [elpa] externals/phps-mode 96eeff74f8 130/135: Added more todo items for bookkeeping and imenu
Date: Sun, 29 Jan 2023 03:11:11 -0500 (EST)

branch: externals/phps-mode
commit 96eeff74f85c180d88723c09700f97dc42b7efc2
Author: christian <christian@cvj.se>
Commit: christian <christian@cvj.se>

    Added more todo items for bookkeeping and imenu
---
 phps-mode-parser-sdt.el    | 21 ++++++++++++++-------
 test/phps-mode-test-ast.el |  4 ++--
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/phps-mode-parser-sdt.el b/phps-mode-parser-sdt.el
index b44ca19edf..853fa94320 100644
--- a/phps-mode-parser-sdt.el
+++ b/phps-mode-parser-sdt.el
@@ -841,6 +841,12 @@
                     ;; (message "potential-uris: %S" potential-uris)
                     ))
 
+                 ((equal space-type 'object-operator)
+                  (setq scope-object-operator space-name))
+
+                 ((equal space-type 'static-member)
+                  (setq scope-static-member space-name))
+
                  )))
             (setq scope-index (1+ scope-index)))))
 
@@ -1596,6 +1602,7 @@
              (symbol-object-operator
               (nth 13 (nth 1 symbol-uri-object)))
              (symbol-hit 0))
+
         (unless (and
                  symbol-object-operator
                  (not (string= (downcase symbol-object-operator) "$this")))
@@ -1637,14 +1644,14 @@
                   (when (<= matching-symbol-start symbol-start)
                     (setq matching-hit t)
                     (setq symbol-hit matching-symbol-id)))
-                (setq matching-symbol-index (1+ matching-symbol-index)))))))
+                (setq matching-symbol-index (1+ matching-symbol-index))))))
 
-        (puthash
-         (list
-          symbol-start
-          symbol-end)
-         symbol-hit
-         phps-mode-parser-sdt-bookkeeping)
+          (puthash
+           (list
+            symbol-start
+            symbol-end)
+           symbol-hit
+           phps-mode-parser-sdt-bookkeeping))
 
         ;; (message
         ;;  "reference symbol uri: %S from %S + %S, start: %S, end: %S, 
object: %S, hit?: %S"
diff --git a/test/phps-mode-test-ast.el b/test/phps-mode-test-ast.el
index 3e77798291..48d1cbdc69 100644
--- a/test/phps-mode-test-ast.el
+++ b/test/phps-mode-test-ast.el
@@ -131,8 +131,9 @@
   "Run test for bookkeeping generation."
   (message "-- Running tests for bookkeeping generation... --\n")
 
-  ;; TODO MVP Not bookkeeping for $var->whatever when $var is not $this
   ;; TODO v2 Should have more delicate handling of isset, !empty condition 
blocks
+  ;; TODO v2 bookkeep and include constants in imenu
+  ;; TODO v2 imenu should contain redeclaration of variables
 
   (phps-mode-test-ast--should-bookkeep
    "<?php\n\n$var = 'abc';\n\nif ($var2) {\n    echo 'This never 
happens';\n}\nif ($var) {\n    echo 'This happens';\n}"
@@ -217,7 +218,6 @@
    '(((7 9) 1) ((15 19) 3) ((25 27) 2) ((32 34) 2) ((37 39) 1) ((41 43) 4) 
((49 52) 7) ((58 61) 6) ((69 72) 5) ((77 80) 6) ((83 86) 5) ((89 91) 4) ((102 
105) 8) ((110 113) 8) ((115 118) 9) ((144 147) 9) ((152 155) 10) ((165 168) 10) 
((174 177) 11) ((182 185) 11) ((191 194) 12) ((199 202) 12) ((207 210) 13) 
((215 220) 14) ((225 230) 14))
    '(("$y" . 7) ("$fn1" . 15) ("$x" . 25) ("$z" . 41) ("$fn" . 49) ("$x2" . 
58) ("$y2" . 69) ("$x3" . 102) ("$x4" . 115) ("$x5" . 152) ("$x6" . 174) ("$x7" 
. 191) ("$x8" . 207) ("$rest" . 215)))
 
-  ;; TODO Make this pass for MVP
   (phps-mode-test-ast--should-bookkeep
    "<?php\n$z = (object) ['name' => 'random', 'doThis' => function() {}];\nif 
($z->name) {\n    echo 'Hit';\n}\nif ($z->doThis()) {\n    echo 'Hit';\n}"
    "Bookkeeping ignoring variable properties that is not $this"



reply via email to

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