[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode c2af31e 240/405: Imenu support now shows hier
From: |
Stefan Monnier |
Subject: |
[elpa] externals/phps-mode c2af31e 240/405: Imenu support now shows hierarchical information |
Date: |
Sat, 13 Jul 2019 10:00:23 -0400 (EDT) |
branch: externals/phps-mode
commit c2af31eb235f13a5c83c93d2eb963353d15d92a9
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>
Imenu support now shows hierarchical information
---
phps-mode-functions.el | 9 +++++----
phps-mode-test-functions.el | 10 +++++++---
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/phps-mode-functions.el b/phps-mode-functions.el
index 08b8604..e7b54fd 100644
--- a/phps-mode-functions.el
+++ b/phps-mode-functions.el
@@ -662,7 +662,8 @@
(cond
((string= token-symbol "{")
- (setq open-namespace-level nesting-level))
+ (setq open-namespace-level nesting-level)
+ (setq in-namespace-declaration nil))
((string= token-symbol ";")
(setq in-namespace-declaration nil))
@@ -685,7 +686,7 @@
(index-pos token-start))
(setq in-class-name index-name)
(when in-namespace-name
- (setq index-name (concat in-namespace-name " | "
index-name)))
+ (setq index-name (concat in-namespace-name " \\ "
index-name)))
(push `(,index-name . ,index-pos) index)))))
(in-function-declaration
@@ -702,9 +703,9 @@
(let ((index-name (format "function %s"
(buffer-substring-no-properties token-start token-end)))
(index-pos token-start))
(when in-class-name
- (setq index-name (concat in-class-name " | " index-name)))
+ (setq index-name (concat in-class-name " -> " index-name)))
(when in-namespace-name
- (setq index-name (concat in-namespace-name " | "
index-name)))
+ (setq index-name (concat in-namespace-name " \\ "
index-name)))
(push `(,index-name . ,index-pos) index)))))
(t
diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el
index aca76ad..a9550e9 100644
--- a/phps-mode-test-functions.el
+++ b/phps-mode-test-functions.el
@@ -594,13 +594,17 @@
(phps-mode-test-with-buffer
"<?php\nclass myClass {\n public function myFunctionA() {}\n
protected function myFunctionB() {}\n}\n"
"Imenu object-oriented file"
- (should (equal (phps-mode-functions-imenu-create-index-function) '(("class
myClass" . 13) ("class myClass | function myFunctionA" . 43) ("class myClass |
function myFunctionB" . 83)))))
+ (should (equal (phps-mode-functions-imenu-create-index-function) '(("class
myClass" . 13) ("class myClass -> function myFunctionA" . 43) ("class myClass
-> function myFunctionB" . 83)))))
(phps-mode-test-with-buffer
"<?php\nnamespace myNamespace {\n class myClass {\n public
function myFunctionA() {}\n protected function myFunctionB() {}\n
}\n}\n"
- "Imenu object-oriented file"
- (should (equal (phps-mode-functions-imenu-create-index-function) '(("class
myClass" . 13) ("class myClass | function myFunctionA" . 43) ("class myClass |
function myFunctionB" . 83)))))
+ "Imenu object-oriented file with namespace, class and function"
+ (should (equal (phps-mode-functions-imenu-create-index-function)
'(("namespace myNamespace" . 17) ("namespace myNamespace \\ class myClass" .
41) ("namespace myNamespace \\ class myClass -> function myFunctionA" . 75)
("namespace myNamespace \\ class myClass -> function myFunctionB" . 119)))))
+ (phps-mode-test-with-buffer
+ "<?php\nnamespace myNamespace;\nclass myClass {\n public function
myFunctionA() {}\n protected function myFunctionB() {}\n}\n"
+ "Imenu object-oriented file with bracket-less namespace, class and function"
+ (should (equal (phps-mode-functions-imenu-create-index-function)
'(("namespace myNamespace" . 17) ("namespace myNamespace \\ class myClass" .
36) ("namespace myNamespace \\ class myClass -> function myFunctionA" . 66)
("namespace myNamespace \\ class myClass -> function myFunctionB" . 106)))))
)
- [elpa] externals/phps-mode 2d4646f 203/405: Work on inline control structure indentation, (continued)
- [elpa] externals/phps-mode 2d4646f 203/405: Work on inline control structure indentation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 202827b 198/405: New indentation algorithm now supports inline control structures, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b2a5700 218/405: Fixed indentation for multi-line optional function arguments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode f7186a1 239/405: Preparations for hierarchical imenu, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 43bf350 216/405: Added tests for token-less lines, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 0de10fa 235/405: Passes first test for imenu, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode f791cee 234/405: Started on unit tests for imenu-index generation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b56a15c 233/405: Removed debugging output, updated todo items, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 73784d0 225/405: Cleaned up tests for indentation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode f7e7c74 219/405: Work on indentation for switch-case, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode c2af31e 240/405: Imenu support now shows hierarchical information,
Stefan Monnier <=
- [elpa] externals/phps-mode 55953de 232/405: Lexer now doesn't find keywords in function names, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b8e9449 247/405: Refactored Imenu to use a persistent variable per buffer, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 67b8701 244/405: Decreased length of imenu items to prevent truncation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode e78d8ed 248/405: Clean-up of indentation code, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode c2db7d3 250/405: Preparations for integration test, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 11309b8 256/405: Updated readme, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode fcc920f 258/405: More preparations for merging indent and Imenu into one function, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 41c12c1 251/405: Updated paths for byte-compilation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 0e927e8 252/405: Fixed compilation command in makefile, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 6593242 257/405: Preparations for doing indentation and imenu in one pass, Stefan Monnier, 2019/07/13