[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 463ceedbbb 6/8: Passing new indent test for l
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode 463ceedbbb 6/8: Passing new indent test for line after commented out assignment |
Date: |
Thu, 27 Jan 2022 15:57:25 -0500 (EST) |
branch: externals/phps-mode
commit 463ceedbbb0155a71b500f747920d6b8a94e01a3
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Passing new indent test for line after commented out assignment
---
phps-mode-indent.el | 13 +++++++++++++
test/phps-mode-test-indent.el | 12 +++++-------
2 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/phps-mode-indent.el b/phps-mode-indent.el
index a00d7b65d9..0977a1a38f 100644
--- a/phps-mode-indent.el
+++ b/phps-mode-indent.el
@@ -531,6 +531,19 @@
(unless (or
line-is-empty-p
line-is-comment-p)
+
+ ;; Does line contain comment?
+ (when (string-match-p
+ "\\(//[^'\"]+$\\|#[^'\"]+$\\|/\\*.+\\*/\\)"
+ line-string)
+ ;; Delete comment region
+ (setq
+ line-string
+ (replace-regexp-in-string
+ "\\(//[^'\"]+$\\|#[^'\"]+$\\|/\\*.+\\*/\\)"
+ ""
+ line-string)))
+
(cond
((= searching-previous-lines 2)
(setq
diff --git a/test/phps-mode-test-indent.el b/test/phps-mode-test-indent.el
index ef7d6110d6..4152c9d414 100644
--- a/test/phps-mode-test-indent.el
+++ b/test/phps-mode-test-indent.el
@@ -660,21 +660,19 @@
"<?php\nif (true) {\n $html .= 'My text'\n . 'and more text';\n
foreach ($data as $key => $fields) {\n $html .= '<strong>' . $key .
'</strong>';\n foreach ($fields as $key => $value) {\n $html
.= '<span>' . $value . '</span>';\n }\n $html .= '</ul></li>';\n
}\n $html .= '</dd>';\n}\n"
"Two nested foreach loops containing string concatenation assignments")
- ;; TODO Make this pass
- (phps-mode-test-indent--should-equal
- "<?php\n$var = Object->myMethod()\n ->myMethod2();\necho 'here';"
- "Line after assignment were an chaining of object methods started")
-
- ;; TODO Make this pass
(phps-mode-test-indent--should-equal
"<?php\n$var = 23; /* 23 = Company */\necho 'was here';"
"Line after line that have an assignment doc-commented out")
- ;; TODO Make this pass
(phps-mode-test-indent--should-equal
"<?php\n$var = 23; // 23 = Company\necho 'was here';"
"Line after line that have an assignment commented out")
+ ;; TODO Make this pass
+ (phps-mode-test-indent--should-equal
+ "<?php\n$var = Object->myMethod()\n ->myMethod2();\necho 'here';"
+ "Line after assignment were an chaining of object methods started")
+
)
(defun phps-mode-test-indent--get-lines-indent-psr-2 ()
- [elpa] externals/phps-mode updated (5ae4886f14 -> 73c4106bbf), Christian Johansson, 2022/01/27
- [elpa] externals/phps-mode f2520450c8 7/8: Indentation improved for multi-line chained object method calls, Christian Johansson, 2022/01/27
- [elpa] externals/phps-mode 6b33c7f4d9 4/8: Removed obsolete information in README, Christian Johansson, 2022/01/27
- [elpa] externals/phps-mode 1eb1866f96 3/8: Removed obsolete docs, Christian Johansson, 2022/01/27
- [elpa] externals/phps-mode c884caf642 2/8: Merge branch 'master' of git.cvj.se:/home/git/emacs-phps-mode, Christian Johansson, 2022/01/27
- [elpa] externals/phps-mode 463ceedbbb 6/8: Passing new indent test for line after commented out assignment,
Christian Johansson <=
- [elpa] externals/phps-mode 61e73b1ce0 1/8: Added indent todo items, Christian Johansson, 2022/01/27
- [elpa] externals/phps-mode 73c4106bbf 8/8: Updated readme and version, Christian Johansson, 2022/01/27
- [elpa] externals/phps-mode 83b0220d5b 5/8: Added new failing indent tests, Christian Johansson, 2022/01/27