Skip to content

Commit 8b5b456

Browse files
committed
1 parent bcfa693 commit 8b5b456

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

swift-mode-indent.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ OFFSET is the offset of the contents."
10421042
(swift-mode:token:text next-token)
10431043
'("for" "while" "repeat" "guard" "switch" "if" "else"
10441044
"defer" "do" "catch"
1045-
"get" "set" "willSet" "didSet" "func" "init" "subscript"
1045+
"get" "set" "willSet" "didSet" "func" "init" "deinit" "subscript"
10461046
"enum" "struct" "actor" "class" "extension"
10471047
"prefix" "postfix" "infix" "precedencegroup"))
10481048
(setq is-declaration-or-control-statement-body t)

swift-mode-lexer.el

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -667,10 +667,10 @@ return non-nil."
667667
;; statements.
668668
(member (swift-mode:token:text previous-token)
669669
'("any" "some" "inout" "borrowing" "consuming" "sending" "in"
670-
"where" "isolated" "each"))
670+
"where" "each"))
671671
(member (swift-mode:token:text next-token)
672672
'("any" "some" "inout" "borrowing" "consuming" "sending" "throws"
673-
"rethrows" "in" "where" "isolated" "each"))
673+
"rethrows" "in" "where" "each"))
674674

675675
;; Suppress implicit semicolon between throws and open parenthesis.
676676
(and (equal (swift-mode:token:text previous-token) "throws")
@@ -738,7 +738,7 @@ return non-nil."
738738
"mutating" "nonmutating" "optional" "override" "postfix"
739739
"prefix" "required" "static" "unowned" "weak" "internal"
740740
"package" "private" "public" "open" "fileprivate" "nonisolated"
741-
"distributed"))
741+
"distributed" "isolated"))
742742
nil)
743743

744744
;; internal(set) private(set) public(set) open(set) fileprivate(set)
@@ -756,7 +756,7 @@ return non-nil."
756756
(swift-mode:backquote-identifier-if-after-dot
757757
(swift-mode:backward-token-simple)))
758758
'("unowned" "internal" "private" "public" "open"
759-
"fileprivate" "nonisolated")))))
759+
"fileprivate" "nonisolated" "isolated")))))
760760
nil)
761761

762762
;; Suppress implicit semicolon after declaration starters.
@@ -774,7 +774,7 @@ return non-nil."
774774
"mutating" "nonmutating" "optional" "override" "postfix"
775775
"prefix" "required" "static" "unowned" "weak" "internal"
776776
"package" "private" "public" "open" "fileprivate" "nonisolated"
777-
"distributed"))
777+
"distributed" "isolated"))
778778
t)
779779

780780
;; Inserts implicit semicolon around keywords that forms single keyword

test/swift-files/indent/declarations.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,15 @@ class Foo {
826826
)
827827
var x = 1
828828
}
829+
830+
// https://github.com/swiftlang/swift-evolution/blob/main/proposals/0371-isolated-synchronous-deinit.md
831+
isolated
832+
deinit {
833+
}
834+
835+
public
836+
deinit {
837+
}
829838
}
830839

831840
// async let

0 commit comments

Comments
 (0)