[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/swift-mode 0c734dd 112/496: Indent multiline hash and arra
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/swift-mode 0c734dd 112/496: Indent multiline hash and array syntax same way as Xcode does |
Date: |
Sun, 29 Aug 2021 11:33:18 -0400 (EDT) |
branch: elpa/swift-mode
commit 0c734dd99901613c653684e34bf529d8574591fd
Author: ap4y <lod@pisem.net>
Commit: ap4y <lod@pisem.net>
Indent multiline hash and array syntax same way as Xcode does
---
swift-mode.el | 4 ++++
test/indentation-tests.el | 23 +++++++++++++++++------
2 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/swift-mode.el b/swift-mode.el
index ac810cd..d094cbf 100644
--- a/swift-mode.el
+++ b/swift-mode.el
@@ -239,6 +239,10 @@
(if (smie-rule-parent-p "{")
swift-indent-offset
(smie-rule-parent))))
+
+ (`(:before . "(")
+ (if (smie-rule-next-p "[") (smie-rule-parent)))
+ (`(:before . "[") (smie-rule-parent))
))
;;; Font lock
diff --git a/test/indentation-tests.el b/test/indentation-tests.el
index 4c9152a..3d35adf 100644
--- a/test/indentation-tests.el
+++ b/test/indentation-tests.el
@@ -694,11 +694,11 @@ let foo = [foo: bar, bar: baz]
"
let foo = [
|bar: baz
- ]
+]
" "
let foo = [
- |bar: baz
- ]
+ |bar: baz
+]
")
(check-indentation indents-declaration/5
@@ -714,11 +714,11 @@ let foo = [foo, bar]
"
let foo = [
|bar
- ]
+]
" "
let foo = [
- |bar
- ]
+ |bar
+]
")
(check-indentation indents-declaration/7
@@ -730,6 +730,17 @@ var result = Dictionary<String, V>()
|foo
")
+(check-indentation indents-multiline-expressions/1
+"
+Foo.bar([
+|bar: baz
+])
+" "
+Foo.bar([
+ |bar: baz
+])
+")
+
(check-indentation indents-type-annotations/1
"
typealias Foo = Bar<Foo.Baz, Foo>
- [nongnu] elpa/swift-mode 95ff004 479/496: Fix indentation of closures inside condition-list, (continued)
- [nongnu] elpa/swift-mode 95ff004 479/496: Fix indentation of closures inside condition-list, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode db3603a 489/496: Highlight async/await, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 4a5f577 488/496: Tweak comments and style, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 86043c2 093/496: Define electric-indent characters, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode b298842 094/496: Merge pull request #26 from ap4y/electric_indent, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 027522d 090/496: Merge pull request #23 from ap4y/flycheck_improvements, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 20e4ecf 099/496: Merge pull request #27 from ap4y/highlight_declaration_with_destructuring, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 53f9042 100/496: Rename swift-mode--font-lock-defaults to swift-font-lock-keywords and, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 72eb603 105/496: Use semver friendly version number, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 021f0ab 104/496: Remove flycheck code from .dir-locals.el as not everyone has flycheck installed, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 0c734dd 112/496: Indent multiline hash and array syntax same way as Xcode does,
ELPA Syncer <=
- [nongnu] elpa/swift-mode 699e896 106/496: Start work on the 0.2 series, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 07f6434 111/496: Fix indentation issues with type annotations, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode abd6e07 130/496: Merge pull request #39 from ap4y/fix_37, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode c664fc2 144/496: Merge pull request #51 from ap4y/fix_default_case_indentation, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode ce72472 141/496: Make all possible operators allowed in string interpolation, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 3298fb1 169/496: Stop overriding user preferences for tab-width., ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 0808a2b 170/496: Add font-lock rules for access modifier keywords, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 52045f0 174/496: Fix issues with several failing tests on emacs 24.4, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 230afd3 175/496: Setup travis matrix with emacs 24.3 and 24.4., ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 5fabebd 196/496: Improve indentation rules for function arguments, ELPA Syncer, 2021/08/29