[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 91fb5402cd 158/212: Added another failing ind
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode 91fb5402cd 158/212: Added another failing indentation and made it pass |
Date: |
Wed, 26 Jan 2022 01:51:19 -0500 (EST) |
branch: externals/phps-mode
commit 91fb5402cdb004cef93c9c15231471cc9a437b3a
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Added another failing indentation and made it pass
---
phps-mode-indent.el | 63 ++++++++++++++++++++++---------------------
test/phps-mode-test-indent.el | 4 +++
2 files changed, 36 insertions(+), 31 deletions(-)
diff --git a/phps-mode-indent.el b/phps-mode-indent.el
index f501591519..b3d4c378b1 100644
--- a/phps-mode-indent.el
+++ b/phps-mode-indent.el
@@ -544,6 +544,37 @@
(+ new-indentation tab-width))))
(goto-char point))
+ ;; echo <<<VAR
+ ;; abc
+ ;; or
+ ;; echo <<<'VAR'
+ ;; abc
+ ;; or
+ ;; echo <<<"VAR"
+ ;; abc
+ ((string-match-p
+ "<<<'?\"?[a-zA-Z0-9_]+'?\"?$"
+ previous-line-string)
+ (setq
+ new-indentation
+ 0))
+
+ ;; echo 'Something' .
+ ;; 'something';
+ ;; but ignore
+ ;; print_r($object)
+ ((and
+ (string-match-p
+ "^[\t ]*\\(echo\\|print$\\|print[\t ]+\\|return\\|die\\)"
+ previous-line-string)
+ (not
+ (string-match-p
+ ";[\t ]*$"
+ previous-line-string)))
+ (setq
+ new-indentation
+ (+ new-indentation tab-width)))
+
;; function myFunction($key,
;; $value)
;; {
@@ -649,21 +680,6 @@
)
- ;; echo <<<VAR
- ;; abc
- ;; or
- ;; echo <<<'VAR'
- ;; abc
- ;; or
- ;; echo <<<"VAR"
- ;; abc
- ((string-match-p
- "<<<'?\"?[a-zA-Z0-9_]+'?\"?$"
- previous-line-string)
- (setq
- new-indentation
- 0))
-
;; $var = 'A line' .
;; 'something';
;; or
@@ -695,22 +711,6 @@
new-indentation
(+ new-indentation tab-width)))
- ;; echo 'Something' .
- ;; 'something';
- ;; but ignore
- ;; print_r($object)
- ((and
- (string-match-p
- "^[\t ]*\\(echo\\|print$\\|print[\t ]+\\|return\\|die\\)"
- previous-line-string)
- (not
- (string-match-p
- ";[\t ]*$"
- previous-line-string)))
- (setq
- new-indentation
- (+ new-indentation tab-width)))
-
;; $variable = array(
;; 'random' =>
;; 'hello'
@@ -1341,6 +1341,7 @@
;; or
;; define('_PRIVATE_ROOT_',
;; 'here');
+ ;; echo 'here';
((and
previous-line-ends-with-terminus
(string= previous-line-ends-with-terminus ";")
diff --git a/test/phps-mode-test-indent.el b/test/phps-mode-test-indent.el
index 1ea722954f..c949ca262f 100644
--- a/test/phps-mode-test-indent.el
+++ b/test/phps-mode-test-indent.el
@@ -372,6 +372,10 @@
"<?php\n\nif (\n (is_array($data)\n && !empty($data['index'])\n
&& (is_a($data['index'], 'Index')\n || is_a($data['Index'],
'Index2')))\n || is_a($data, 'WC_Index')\n) {\n\n}\n"
"Line after multi-line condition in parenthesis 2")
+ (phps-mode-test-indent--should-equal
+ "<?php\nfunction myFunction()\n{\n return
self::getOption('username')\n && self::getOption('password');\n}\n"
+ "Line after line that started a multi-line return expression")
+
)
(defun phps-mode-test-indent--get-lines-indent-psr-2 ()
- [elpa] externals/phps-mode dc361309e0 124/212: Passing all indentation tests, (continued)
- [elpa] externals/phps-mode dc361309e0 124/212: Passing all indentation tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode a62e6be40e 133/212: Fixed indentation on line after print_r, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 5391551287 143/212: Added a new indent test and made it pass, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode ffda8f1b5c 128/212: Added TODO item, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 2ef1168cb1 155/212: Added new failing indentation tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 519888fe79 150/212: Added another failing indent test, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 7ec071188a 137/212: Added more indent unit tests for nested function calls, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 837412c0e5 140/212: Improved indentation on lines starting with a closing bracket, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode cdbcd5ebe6 154/212: Added a new failing indent test and made it pass, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode c2a7af2a98 142/212: Updated copyright years, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 91fb5402cd 158/212: Added another failing indentation and made it pass,
Christian Johansson <=
- [elpa] externals/phps-mode 66d4352052 169/212: Added more failing indent tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 0ca0e447b8 167/212: Improved indentation on lines starting with a closing bracket, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 18221a85f0 177/212: Added failing parse test for multiple swith case conditions, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode a2c61b9e7c 174/212: Started refactoring of indentation functions, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode e15d602e46 179/212: More TODO items, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 22c4f31716 178/212: Added TODO items, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode c05d97fc31 182/212: Disabled debug-mode in this branch, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode d095e757e6 186/212: Added failing imenu test, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 2dc9280bcd 185/212: More work, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 87974abfcc 190/212: Improved indentation after lines containing => symbol, Christian Johansson, 2022/01/26