[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 84d447e4e6 119/212: Added TODO item
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode 84d447e4e6 119/212: Added TODO item |
Date: |
Wed, 26 Jan 2022 01:51:11 -0500 (EST) |
branch: externals/phps-mode
commit 84d447e4e6b52aed8ca2344f04732f3127503cfe
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Added TODO item
---
phps-mode-indent.el | 42 +++++++++++++++++++++++++++++++++++-------
1 file changed, 35 insertions(+), 7 deletions(-)
diff --git a/phps-mode-indent.el b/phps-mode-indent.el
index 61ae9aea0b..99e0358407 100644
--- a/phps-mode-indent.el
+++ b/phps-mode-indent.el
@@ -713,7 +713,16 @@
(when end-of-switch-statement
(setq
new-indentation
- (- new-indentation tab-width)))))))
+ (- new-indentation tab-width)))
+
+ ;; TODO should indent double if previous
+ ;; line ended a multi-line assignment
+ ;; if (true) {
+ ;; $var =
+ ;; 'abc';
+ ;; }
+
+ ))))
;; switch (blala):
;; case bla:
@@ -763,13 +772,13 @@
(end-of-line)
(forward-char -1)
- ;; TODO Need to determine if bracket started on assignment
line or not
(let ((not-found t)
(is-assignment nil)
(is-string-doc)
(parenthesis-level 0)
(is-bracket-less-command nil)
- (is-same-line-p t))
+ (is-same-line-p t)
+ (bracket-opened-on-first-line))
(while
(and
not-found
@@ -818,6 +827,20 @@
(line-beginning-position)
(line-end-position)))))
+ ;; When we have an assignment
+ ;; keep track if bracket was opened on first
+ ;; line
+ (when (and
+ is-assignment
+ (string-match-p
+ "[([]"
+ (buffer-substring-no-properties
+ (line-beginning-position)
+ (line-end-position))))
+ (setq
+ bracket-opened-on-first-line
+ t))
+
;; echo 'there' .
;; 'here';
;; echo 'here';
@@ -835,16 +858,21 @@
;; 'here'
;; );
;; echo 'here';
+ ;; but not cases like
+ ;; $var = 'abc'
+ ;; . 'def' . __(
+ ;; 'okeoke'
+ ;; ) . 'ere';
+ ;; echo 'here';
+ ;; NOTE stuff like $var = array(\n 4\n);\n
+ ;; will end assignment but also decrease
previous-bracket-level
(when (and
(not is-same-line-p)
(or
(and
is-assignment
- (= previous-bracket-level 0))
+ (not bracket-opened-on-first-line))
is-bracket-less-command))
-
- ;; NOTE stuff like $var = array(\n 4\n);\n
- ;; will end assignment but also decrease
previous-bracket-level
(setq
new-indentation
(- new-indentation tab-width))))
- [elpa] externals/phps-mode 8fa61fa1f2 063/212: Passing bookkeeping of interface method arguments, (continued)
- [elpa] externals/phps-mode 8fa61fa1f2 063/212: Passing bookkeeping of interface method arguments, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 7a636ccd28 078/212: Removed obsolete file parser-grammar-macro.el, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode ee211dac6a 084/212: Started on indentation tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode f65ca852cd 092/212: Passed another indent test, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 9a2573939a 094/212: More wrestling, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 7c0cb57312 098/212: Added more multi-line assignment indent tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 3a594466d5 100/212: Passed indent test for multi-line assignments, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 7deebc5f79 101/212: Improved indent test descriptions, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode d5d80017bc 104/212: Passed indent tests for concatenated string, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode e083e90ac0 108/212: Passing more indentation tests for PSR-2, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 84d447e4e6 119/212: Added TODO item,
Christian Johansson <=
- [elpa] externals/phps-mode 1ab6ac7324 131/212: Added failing tests for indentation, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 7135a30446 173/212: Updated TODO items, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 63c5fef240 175/212: Started on tests for more basic functions of indentation, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 735f1e0c89 176/212: More notes, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 73d460d5a4 181/212: Passing lexer tests with optimized lexer, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode e5df43eea9 187/212: More tweaking of indentation helpers, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 413547fbf1 188/212: Searching for previous bracket now steps over optional PHP starting tags, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 4b4a96fda2 208/212: Improved cache filename, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode ef97058a67 184/212: Added more tests for indentation helper functions, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode a1af5b11fb 040/212: More work on bookkeeping of class properties via AST, Christian Johansson, 2022/01/26