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

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

[nongnu] elpa/swift-mode 848d088 310/496: Fix indentation after attribut


From: ELPA Syncer
Subject: [nongnu] elpa/swift-mode 848d088 310/496: Fix indentation after attributes with arguments
Date: Sun, 29 Aug 2021 11:33:57 -0400 (EDT)

branch: elpa/swift-mode
commit 848d0886438c9868896c8991d40418166fddef10
Author: taku0 <mxxouy6x3m_github@tatapa.org>
Commit: taku0 <mxxouy6x3m_github@tatapa.org>

    Fix indentation after attributes with arguments
---
 swift-mode-lexer.el                 | 13 ++++++++++++-
 test/swift-files/declarations.swift | 11 ++++++++++-
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/swift-mode-lexer.el b/swift-mode-lexer.el
index 64d91c4..6469890 100644
--- a/swift-mode-lexer.el
+++ b/swift-mode-lexer.el
@@ -283,7 +283,18 @@
       t)
 
      ;; Supress implicit semicolon after attributes.
-     ((string-prefix-p "@" (swift-mode:token:text previous-token)) nil)
+     ((string-prefix-p "@" (swift-mode:token:text previous-token))
+      nil)
+
+     ;; Supress implicit semicolon after attributes with arguments.
+     ((and
+       (eq (swift-mode:token:type previous-token) '\))
+       (save-excursion
+         (backward-list)
+         (string-prefix-p
+          "@"
+          (swift-mode:token:text (swift-mode:backward-token-simple)))))
+      nil)
 
      ;; Inserts implicit semicolon before keywords that behave like method
      ;; names.
diff --git a/test/swift-files/declarations.swift 
b/test/swift-files/declarations.swift
index 3f9549b..3a353de 100644
--- a/test/swift-files/declarations.swift
+++ b/test/swift-files/declarations.swift
@@ -29,7 +29,7 @@ class Foo {
       =
       xx
 
-    @ABC
+    @ABC(aaa)
     final
       unowned(safe)
       fileprivate
@@ -234,6 +234,15 @@ func
     foo()
 }
 
+func
+  foo()
+  ->
+  @A(aaa)
+  B {
+    foo()
+    foo()
+}
+
 // Enumeration declarations
 
 fileprivate



reply via email to

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