[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/swift-mode cf219aa 217/496: Improve indentation of the nes
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/swift-mode cf219aa 217/496: Improve indentation of the nested arrays and dictionaries |
Date: |
Sun, 29 Aug 2021 11:33:39 -0400 (EDT) |
branch: elpa/swift-mode
commit cf219aacdc090b98ec081672ad2d7b87b91c2339
Author: ap4y <lod@pisem.net>
Commit: ap4y <lod@pisem.net>
Improve indentation of the nested arrays and dictionaries
---
swift-mode.el | 2 +-
test/indentation-tests.el | 54 +++++++++++++++++++++++++++++++++++++++--------
2 files changed, 46 insertions(+), 10 deletions(-)
diff --git a/swift-mode.el b/swift-mode.el
index 41b7689..2c7178d 100644
--- a/swift-mode.el
+++ b/swift-mode.el
@@ -376,7 +376,7 @@
(`(:before . "[")
(cond
((smie-rule-prev-p "->") swift-indent-offset)
- ((smie-rule-parent-p "[") swift-indent-offset)
+ ((smie-rule-parent-p "[") (smie-rule-parent swift-indent-offset))
(t (smie-rule-parent))))
(`(:after . "->") (smie-rule-parent swift-indent-offset))
))
diff --git a/test/indentation-tests.el b/test/indentation-tests.el
index 3bb1623..0aea214 100644
--- a/test/indentation-tests.el
+++ b/test/indentation-tests.el
@@ -709,15 +709,6 @@ class Foo: Bar<A, B,
|C>
")
-(check-indentation indents-class-declaration/8
- "
-class Foo: Bar<A, B,
-|[C]>
-" "
-class Foo: Bar<A, B,
- |[C]>
-")
-
(check-indentation indents-class-declaration/9
"
class Foo<A: B<C>>:
@@ -1022,6 +1013,51 @@ let foo = [
|[
")
+(check-indentation indents-declaration/13
+ "
+let foo = [
+|[
+ bar: baz
+ ]
+]
+" "
+let foo = [
+ |[
+ bar: baz
+ ]
+]
+")
+
+(check-indentation indents-declaration/14
+ "
+let foo = [
+ [
+ |bar: baz
+ ]
+]
+" "
+let foo = [
+ [
+ |bar: baz
+ ]
+]
+")
+
+(check-indentation indents-declaration/15
+ "
+let foo = [
+ [
+ bar: baz
+|]
+]
+" "
+let foo = [
+ [
+ bar: baz
+ |]
+]
+")
+
(check-indentation indents-multiline-expressions/1
"
Foo.bar([foo: bar,
- [nongnu] elpa/swift-mode 34f0c95 152/496: Correct source argument extraction in flycheck checker, (continued)
- [nongnu] elpa/swift-mode 34f0c95 152/496: Correct source argument extraction in flycheck checker, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 773219a 142/496: Treat default clause for case statement as a whole with colon in bnf, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode d7b13b0 150/496: Convert targeted sdk flycheck option from list to string, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode b0fea47 168/496: Fix eval-after-load problems when byte-compiled., ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode e859716 176/496: Merge pull request #75 from ap4y/test_against_24_4, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode f2b923e 178/496: Improve case statement grammar, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 75aa277 188/496: Add separate lexer rule for return type arrow symbol "->", prevent, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 1c4253b 191/496: Improve indentation for nested hash/array statements, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode ebc60c8 197/496: Make closure block in function argument close at the offset 0, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 4bdbc23 211/496: Normalize indentation for function declration with argument list on the, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode cf219aa 217/496: Improve indentation of the nested arrays and dictionaries,
ELPA Syncer <=
- [nongnu] elpa/swift-mode 655bd60 229/496: Fix indent in trailing closure, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode a2f5b33 233/496: Fix indent when operator hanging after comment, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 69783af 243/496: added guard statement, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode f94e437 259/496: Fix wrong offset for multiline, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode e5f28f8 268/496: Fix case-: for default, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 63eae17 001/496: Initial commit, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode fdc576f 019/496: Fix for older Emacs(< 24.3), ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 29857ae 002/496: Add initial files, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 7e3bb8e 008/496: Add package deps, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode bb506d0 015/496: Add flycheck-cask to dir-locals, ELPA Syncer, 2021/08/29