Skip to content

Commit 4cdb841

Browse files
committed
1 parent b06c97b commit 4cdb841

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

swift-mode-lexer.el

+5-1
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,11 @@ return non-nil."
614614
"isolated" "each"))
615615
(member (swift-mode:token:text next-token)
616616
'("any" "some" "inout" "borrowing" "consuming" "throws"
617-
"rethrows" "in" "where" "isolated" "each")))
617+
"rethrows" "in" "where" "isolated" "each"))
618+
619+
;; Suppress implicit semicolon between throws and open parenthesis.
620+
(and (equal (swift-mode:token:text previous-token) "throws")
621+
(eq (swift-mode:token:type next-token) '\()))
618622
nil)
619623

620624
;; Before async

test/swift-files/indent/declarations.swift

+11
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,17 @@ func foo
489489
) {
490490
}
491491

492+
func foo()
493+
throws
494+
(
495+
any
496+
Error
497+
)
498+
->
499+
Int {
500+
1
501+
}
502+
492503
// Enumeration declarations
493504

494505
fileprivate

test/swift-files/indent/statements.swift

+12
Original file line numberDiff line numberDiff line change
@@ -1228,6 +1228,18 @@ catch
12281228
foo()
12291229
}
12301230

1231+
do
1232+
throws
1233+
(
1234+
any
1235+
Error
1236+
) {
1237+
foo()
1238+
} catch
1239+
let
1240+
e {
1241+
}
1242+
12311243
// Multi-Pattern Catch Clauses
12321244
// https://github.com/apple/swift-evolution/blob/master/proposals/0276-multi-pattern-catch-clauses.md
12331245

0 commit comments

Comments
 (0)