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

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

[nongnu] elpa/swift-mode 49cf361c02 1/7: Fix indentation for async let


From: ELPA Syncer
Subject: [nongnu] elpa/swift-mode 49cf361c02 1/7: Fix indentation for async let
Date: Sat, 18 Jun 2022 04:58:56 -0400 (EDT)

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

    Fix indentation for async let
---
 swift-mode-lexer.el                        | 4 ++--
 test/swift-files/indent/declarations.swift | 6 ++++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/swift-mode-lexer.el b/swift-mode-lexer.el
index bbb4e6afc0..6c91d4b41c 100644
--- a/swift-mode-lexer.el
+++ b/swift-mode-lexer.el
@@ -455,7 +455,7 @@ Return nil otherwise."
      ;;   async -> Int
      ;; let b = t as (Int, Int)
      ;; async
-     ;; let c = 1
+     ;;   let c = 1
      ((equal (swift-mode:token:text next-token) "async")
       (equal (swift-mode:token:text (save-excursion
                                       (swift-mode:forward-token-simple)
@@ -532,7 +532,7 @@ Return nil otherwise."
      ;; Suppress implicit semicolon after keywords that cannot end statements.
      ((member (swift-mode:token:text previous-token)
               '("while" "for" "switch" "case" "default" "catch" "if" "guard"
-                "let" "var" "throw" "import"))
+                "let" "var" "throw" "import" "async"))
       nil)
 
      ;; Inserts implicit semicolon before keywords that starts a new
diff --git a/test/swift-files/indent/declarations.swift 
b/test/swift-files/indent/declarations.swift
index 45fa4e3587..30a96363d9 100644
--- a/test/swift-files/indent/declarations.swift
+++ b/test/swift-files/indent/declarations.swift
@@ -742,8 +742,10 @@ class Foo {
 
 func foo(f: @escaping (Int, Int) async -> Int, t: (Int, Int)) async {
     let a = f as (Int, Int)
-      async -> Int
+      async
+      ->
+      Int
     let b = t as (Int, Int)
     async
-    let c = 1
+      let c = 1
 }



reply via email to

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