branch: externals/phps-mode
commit d4f0db2c0c25807c63627341e3c988582577d523
Author: Christian Johansson <christ...@cvj.se>
Commit: Christian Johansson <christ...@cvj.se>

    Added failing bookkeeping test
---
 TODO.md                    | 12 +++++++++++-
 test/phps-mode-test-ast.el | 13 ++++++++++++-
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/TODO.md b/TODO.md
index 04ea30faeb..5eeef4db3b 100644
--- a/TODO.md
+++ b/TODO.md
@@ -2,6 +2,11 @@
 
 ## Indentation
 
+* Lines after comment looking like an assignment like:
+
+$var = 23; // 23 = Company
+    echo 'was here';
+
 ## Code intelligence
 
 * Bookkeeping of chained object operators like WC()->cart->subtotal
@@ -18,4 +23,9 @@
     }
 
 * Imenu-generation of conditionally defined functions and classes
-* Fix race-condition in incremental parser when running in threads
+* Bookkeeping of class properties inside condition lists
+* Fix race-condition in incremental parser when running asynchronous using 
threads
+
+Perform an edit while an incremental parse is going to reproduce
+
+Fix by reloading file or running C-r to rescan and clear cache
diff --git a/test/phps-mode-test-ast.el b/test/phps-mode-test-ast.el
index e33c0bf077..dfc4d868b4 100644
--- a/test/phps-mode-test-ast.el
+++ b/test/phps-mode-test-ast.el
@@ -36,9 +36,14 @@
       ;;        (car (cdr production))))))
       (phps-mode-ast--generate)
       (phps-mode-ast-bookkeeping--generate)
+      (message "bookkeeping: %S" (phps-mode-test--hash-to-list
+         phps-mode-ast-bookkeeping--index
+         t))
       (should
        (equal
-        (phps-mode-test--hash-to-list phps-mode-ast-bookkeeping--index t)
+        (phps-mode-test--hash-to-list
+         phps-mode-ast-bookkeeping--index
+         t)
         bookkeeping)))))
 
 (defun phps-mode-test-ast--buffer-contents (buffer-contents name logic)
@@ -412,6 +417,12 @@
    "Bookkeeping of self reference inside arrow function inside of static 
method"
    '((" class myClass static id $var" 1) ((30 34) 1) (" class myClass function 
myMethod id $a" 1) ((69 71) 1) (" class myClass function myMethod arrow 
function 1 id $b" 1) ((85 87) 1) ((98 102) 1) ((105 107) 1) ((110 112) 1)))
 
+  ;; TODO Make this test pass
+  ;; (phps-mode-test-ast--should-bookkeep
+  ;;  "<?php\nnamespace myNamespace;\nclass myClass\n{\n    private $property1 
= '';\n    private $property2;\n    protected function myMethod(\n        
$argument1,\n        $argument2,\n        $argument3\n    ) {\n        if 
($this->property2) {\n            echo 'was here';\n        }\n        /* 
@codingStandardsIgnoreEnd */\n        if (\n            $argument1\n            
&& $argument2\n            && $argument3\n            && $argument4\n           
 && !empty($argument1['index']) [...]
+  ;;  "Bookkeeping of properties inside if condition list"
+  ;;  '((" namespace myNamespace class myClass id $property1" 1) ((58 68) 1) 
(" namespace myNamespace class myClass id $property2" 1) ((87 97) 1) (" 
namespace myNamespace class myClass function myMethod id $this" 1) (" namespace 
myNamespace class myClass function myMethod id $argument1" 1) ((140 150) 1) (" 
namespace myNamespace class myClass function myMethod id $argument2" 1) ((160 
170) 1) (" namespace myNamespace class myClass function myMethod id $argument3" 
1) ((180 190) 1) ((211 216 [...]
+
   (message "\n-- Ran tests for bookkeeping generation. --"))
 
 (defun phps-mode-test-ast ()

Reply via email to