Skip to content

Commit c2fe477

Browse files
committed
Fix indentation of consuming func
1 parent 858fa84 commit c2fe477

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

swift-mode-lexer.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -821,10 +821,10 @@ move point to the end of the regexp and return non-nil."
821821
;; Suppress implicit semicolon around keywords that cannot start or end
822822
;; statements.
823823
(member (swift-mode:token:text previous-token)
824-
'("any" "some" "inout" "borrowing" "consuming" "sending" "in"
824+
'("any" "some" "inout" "sending" "in"
825825
"where" "each"))
826826
(member (swift-mode:token:text next-token)
827-
'("any" "some" "inout" "borrowing" "consuming" "sending" "throws"
827+
'("any" "some" "inout" "sending" "throws"
828828
"rethrows" "in" "where" "each"))
829829

830830
;; Suppress implicit semicolon between throws and open parenthesis.
@@ -893,7 +893,7 @@ move point to the end of the regexp and return non-nil."
893893
"mutating" "nonmutating" "optional" "override" "postfix"
894894
"prefix" "required" "static" "unowned" "weak" "internal"
895895
"package" "private" "public" "open" "fileprivate" "nonisolated"
896-
"distributed" "isolated"))
896+
"distributed" "isolated" "borrowing" "consuming"))
897897
nil)
898898

899899
;; internal(set) private(set) public(set) open(set) fileprivate(set)

test/swift-files/indent/declarations.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,14 @@ class Foo {
835835
public
836836
deinit {
837837
}
838+
839+
consuming
840+
func foo() {
841+
}
842+
843+
borrowing
844+
func foo() {
845+
}
838846
}
839847

840848
// async let

0 commit comments

Comments
 (0)