emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/swift-mode abd6e07 130/496: Merge pull request #39 from ap


From: ELPA Syncer
Subject: [nongnu] elpa/swift-mode abd6e07 130/496: Merge pull request #39 from ap4y/fix_37
Date: Sun, 29 Aug 2021 11:33:22 -0400 (EDT)

branch: elpa/swift-mode
commit abd6e07a3b2b7eff9fc124996988d82fea0940ca
Merge: b43c1e2 e168b34
Author: Chris Barrett <chris.d.barrett@me.com>
Commit: Chris Barrett <chris.d.barrett@me.com>

    Merge pull request #39 from ap4y/fix_37
    
    Don't use implicit semicolon for multi-line dot expressions
---
 swift-mode.el             |  3 ++-
 test/indentation-tests.el | 18 ++++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/swift-mode.el b/swift-mode.el
index c590853..bc96468 100644
--- a/swift-mode.el
+++ b/swift-mode.el
@@ -186,7 +186,8 @@
 
 (defun swift-smie--implicit-semi-p ()
   (save-excursion
-    (not (or (memq (char-before) '(?\{ ?\[ ?\,))
+    (not (or (memq (char-before) '(?\{ ?\[ ?, ?.))
+             (memq (char-after (+(point) 1)) '(?.))
              (looking-back swift-smie--operators-regexp (- (point) 3) t)
              ))))
 
diff --git a/test/indentation-tests.el b/test/indentation-tests.el
index 5f4d394..3b1c14f 100644
--- a/test/indentation-tests.el
+++ b/test/indentation-tests.el
@@ -774,6 +774,24 @@ Foo.bar(bar?,
         |baz)
 ")
 
+(check-indentation indents-multiline-expressions/4
+                   "
+let json_ary = NSJSONSerialization.
+|JSONObjectWithData(data, options: nil, error: &json_err) as NSArray
+" "
+let json_ary = NSJSONSerialization.
+               |JSONObjectWithData(data, options: nil, error: &json_err) as 
NSArray
+")
+
+(check-indentation indents-multiline-expressions/5
+                   "
+let json_ary = NSJSONSerialization
+|.JSONObjectWithData(data, options: nil, error: &json_err) as NSArray
+" "
+let json_ary = NSJSONSerialization
+               |.JSONObjectWithData(data, options: nil, error: &json_err) as 
NSArray
+")
+
 (check-indentation indents-type-annotations/1
                    "
 typealias Foo = Bar<Foo.Baz, Foo>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]