[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode e38fbe653b 1/3: Make failing test pass
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode e38fbe653b 1/3: Make failing test pass |
Date: |
Mon, 10 Apr 2023 01:58:05 -0400 (EDT) |
branch: externals/phps-mode
commit e38fbe653b10317558610be50f168df04a3d0003
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Make failing test pass
---
phps-mode-parser-sdt.el | 2 ++
test/phps-mode-test-ast.el | 7 +++++++
2 files changed, 9 insertions(+)
diff --git a/phps-mode-parser-sdt.el b/phps-mode-parser-sdt.el
index eb6cb55909..1c53217c73 100644
--- a/phps-mode-parser-sdt.el
+++ b/phps-mode-parser-sdt.el
@@ -1370,6 +1370,8 @@
;; Symbol is inside function inside namespace
(symbol-function
(let ((imenu-nail2 (format "function %s" symbol-function)))
+ (message "imenu-nail: %S" imenu-nail)
+ (message "imenu-nail2: %S" imenu-nail2)
(unless
(gethash
symbol-name
diff --git a/test/phps-mode-test-ast.el b/test/phps-mode-test-ast.el
index 880e77841f..5fff99568e 100644
--- a/test/phps-mode-test-ast.el
+++ b/test/phps-mode-test-ast.el
@@ -120,6 +120,13 @@
"Run test for bookkeeping generation."
(message "-- Running tests for bookkeeping generation... --\n")
+ (phps-mode-test-ast--should-bookkeep
+ "<?php
+\nnamespace myNamespace;\n\nfunction myFunction()\n{\n $var = 'abc';\n
if ($var) {\n echo 'Hit';\n }\n}"
+ "Bookkeeping of namespaced function with variables."
+ '(((177 184) 1) ((256 261) 2) ((444 451) 5) ((472 479) 5) ((656 663) 8)
((684 691) 8) ((718 725) 9) ((748 755) 9) ((774 781) 9) ((811 818) 10) ((841
848) 10) ((867 874) 10))
+ '(("class AbstractClass" ("declaration" . 22) ("function getValue"
("declaration" . 121)) ("function prefixValue" ("declaration" . 165) ("$prefix"
. 177)) ("function printOut" ("declaration" . 229))) ("class ConcreteClass1"
("declaration" . 297) ("function getValue" ("declaration" . 359)) ("function
prefixValue" ("declaration" . 432) ("$prefix" . 444))) ("class ConcreteClass2"
("declaration" . 512) ("function getValue" ("declaration" . 571)) ("function
prefixValue" ("declaration" . 64 [...]
+
;; TODO v1 Symbol namespace should be class | interface | trait / symbol
;; TODO v2 Should have more delicate handling of isset, !empty condition
blocks
;; TODO v2 Should properly bookkeep inside potentially endlessly nested
anonymous functions / arrow functions / anonymous classes