[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode ec69d07 193/405: Added a failing class declar
From: |
Stefan Monnier |
Subject: |
[elpa] externals/phps-mode ec69d07 193/405: Added a failing class declaration indentation case |
Date: |
Sat, 13 Jul 2019 10:00:11 -0400 (EDT) |
branch: externals/phps-mode
commit ec69d072888638b8c00e466c081d6be0f8ecf03c
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>
Added a failing class declaration indentation case
---
phps-mode-functions.el | 4 +++-
phps-mode-test-functions.el | 12 ++++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/phps-mode-functions.el b/phps-mode-functions.el
index 77cd287..3434e9c 100644
--- a/phps-mode-functions.el
+++ b/phps-mode-functions.el
@@ -142,12 +142,14 @@
(progn
(setq in-class-declaration nil)
(setq in-class-declaration-level 0)
-
+
+ ;; TODO Should only do this if class-declaration was
not started on this line
(setq column-level (1- column-level))
(setq nesting-start (1- nesting-start))
(pop nesting-stack)
(when first-token-on-line
+
(setq after-class-declaration t)
(setq first-token-is-nesting-increase nil)
(setq first-token-is-nesting-decrease t))
diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el
index 346e30e..dfc3668 100644
--- a/phps-mode-test-functions.el
+++ b/phps-mode-test-functions.el
@@ -179,12 +179,24 @@
(should (equal '((1 (0 0)) (2 (0 0)) (3 (0 0)) (4 (1 0)) (5 (1 0)) (6 (2
0)) (7 (2 0)) (8 (3 0)) (9 (2 0)) (10 (1 0)) (11 (0 0)))
(phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
(phps-mode-test-with-buffer
+ "<?php\nnamespace myNamespace\n{\n class myClass {\n public
function myFunction()\n {\n echo 'my statement';\n }\n
}\n}\n"
+ "Regular PHP with namespaces, classes and functions"
+ (should (equal '((1 (0 0)) (2 (0 0)) (3 (0 0)) (4 (1 0)) (5 (2 0)) (6 (2
0)) (7 (3 0)) (8 (2 0)) (9 (1 0)) (10 (0 0)))
(phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
+
+ (phps-mode-test-with-buffer
"<?php\nclass MyClass extends MyAbstract implements\n myInterface,\n
myInterface2\n{\n}\n"
"Class multi-line implements"
;; (message "Tokens: %s" phps-mode-lexer-tokens)
(should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (1 0)) (5 (0 0)) (6 (0
0))) (phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
(phps-mode-test-with-buffer
+ "<?php\nclass MyClass\n extends MyAbstract\n implements myInterface,
myInterface2\n{\n}\n"
+ "Class multi-line extends and implements"
+ ;; (message "Tokens: %s" phps-mode-lexer-tokens)
+ (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (1 0)) (5 (0 0)) (6 (0
0))) (phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
+
+
+ (phps-mode-test-with-buffer
"<?php\n/**\n *\n */\nnamespace Aomebo\n{\n /**\n *\n */\n
class Base\n {\n }\n}\n"
"Namespace and class with doc-comments"
(should (equal '((1 (0 0)) (2 (0 0)) (3 (0 1)) (4 (0 1)) (5 (0 0)) (6 (0
0)) (7 (1 0)) (8 (1 1)) (9 (1 1)) (10 (1 0)) (11 (1 0)) (12 (1 0)) (13 (0 0)))
(phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
- [elpa] externals/phps-mode a0cbcd1 186/405: More work on indentation of multi-line IF-expressions, (continued)
- [elpa] externals/phps-mode a0cbcd1 186/405: More work on indentation of multi-line IF-expressions, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode d7c5f67 190/405: More work on nesting-stack, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 253839f 170/405: Added indentation unit tests for concatenated strings outside assignments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode e38794b0 197/405: More conceptual work on algorithm for inline control structures, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 9db28d9 185/405: Added verbose flag for unit tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 2a1ed52 196/405: Optimized algorithm for indentation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode a30c3f6 177/405: More work on indentation tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode e8a8d41 204/405: Merged remote changes, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode faa4e00 201/405: Started on conceptually describing algorithm for multi-line assignment indentation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 874701d 195/405: Work on alternative and inline control structure syntax with new algorithm, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode ec69d07 193/405: Added a failing class declaration indentation case,
Stefan Monnier <=
- [elpa] externals/phps-mode 164b77e 205/405: Unit test for alternative control syntax passes with new algorithm, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode e8658c8 192/405: New indentation algorithm now passes class unit tests, started on indentation document, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode ba9d8a0 199/405: More organization of tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 86404c8 207/405: New algorithm now passes tests for alternative control structure, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 8b4c188 188/405: Now able to detect indent change of scope with same nesting level, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 91715f6 217/405: Added another test for multi-line function arguments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 75c4af4 214/405: Fixed indentation for lines wrapped in scripting open/close, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode d754163 221/405: More work on multi-line token-less lines, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 8947e6e 202/405: Conceptual work on indentation-calculation for multi-line assignment, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode fc2e8b7 212/405: Added logic to indent token-less lines as well, Stefan Monnier, 2019/07/13