Skip to content

Commit

Permalink
Support nonisolated(unsafe)
Browse files Browse the repository at this point in the history
  • Loading branch information
taku0 committed Feb 17, 2024
1 parent 23f5fc5 commit 25cf823
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions swift-mode-lexer.el
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ return non-nil."
nil)

;; internal(set) private(set) public(set) open(set) fileprivate(set)
;; unowned(safe) unowned(unsafe)
;; unowned(safe) unowned(unsafe) nonisolated(unsafe)
((and
(eq (swift-mode:token:type previous-token) '\))
(save-excursion
Expand All @@ -688,7 +688,7 @@ return non-nil."
(swift-mode:backquote-identifier-if-after-dot
(swift-mode:backward-token-simple)))
'("unowned" "internal" "private" "public" "open"
"fileprivate")))))
"fileprivate" "nonisolated")))))
nil)

;; Suppress implicit semicolon after declaration starters.
Expand Down
8 changes: 8 additions & 0 deletions test/swift-files/indent/declarations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,14 @@ class Foo {
package
func foo() {
}

func foo() async {
nonisolated
(
unsafe
)
var x = 1
}
}

// async let
Expand Down

0 comments on commit 25cf823

Please sign in to comment.