diff --git a/swift-mode-font-lock.el b/swift-mode-font-lock.el index 8d25e53..4b9c875 100644 --- a/swift-mode-font-lock.el +++ b/swift-mode-font-lock.el @@ -541,7 +541,7 @@ Return nil otherwise." '("associatedtype" "class" "deinit" "enum" "extension" "fileprivate" "func" "import" "init" "inout" "internal" "let" "open" "operator" "private" "protocol" "public" "some" "static" "struct" "subscript" "typealias" "var" - "actor") + "actor" "nonisolated" "isolated") "Keywords used in declarations.") (defconst swift-mode:statement-keywords diff --git a/swift-mode-lexer.el b/swift-mode-lexer.el index 14165f2..b0ecfcd 100644 --- a/swift-mode-lexer.el +++ b/swift-mode-lexer.el @@ -431,9 +431,10 @@ Return nil otherwise." ;; Suppress implicit semicolon around keywords that cannot start or end ;; statements. (member (swift-mode:token:text previous-token) - '("some" "inout" "in" "where")) + '("some" "inout" "in" "where" "isolated")) (member (swift-mode:token:text next-token) - '("some" "inout" "throws" "rethrows" "async" "in" "where"))) + '("some" "inout" "throws" "rethrows" "in" "where" + "isolated"))) nil) ;; Inserts semicolon before open curly bracket. @@ -458,7 +459,7 @@ Return nil otherwise." '("indirect" "convenience" "dynamic" "final" "infix" "lazy" "mutating" "nonmutating" "optional" "override" "postfix" "prefix" "required" "static" "unowned" "weak" "internal" - "private" "public" "open" "fileprivate")) + "private" "public" "open" "fileprivate" "nonisolated")) nil) ;; internal(set) private(set) public(set) open(set) fileprivate(set) @@ -491,7 +492,7 @@ Return nil otherwise." '("indirect" "convenience" "dynamic" "final" "infix" "lazy" "mutating" "nonmutating" "optional" "override" "postfix" "prefix" "required" "static" "unowned" "weak" "internal" - "private" "public" "open" "fileprivate")) + "private" "public" "open" "fileprivate" "nonisolated")) t) ;; Inserts implicit semicolon around keywords that forms single keyword diff --git a/test/swift-files/indent/declarations.swift b/test/swift-files/indent/declarations.swift index 52cd3b5..2934376 100644 --- a/test/swift-files/indent/declarations.swift +++ b/test/swift-files/indent/declarations.swift @@ -338,6 +338,9 @@ private B> ( x: + @A + isolated + inout Int, y: Int @@ -620,7 +623,8 @@ fileprivate B = D { func foo() - func foo() + nonisolated + func foo() } diff --git a/test/swift-files/indent/identifiers.swift b/test/swift-files/indent/identifiers.swift index 9c4afa0..db87d1a 100644 --- a/test/swift-files/indent/identifiers.swift +++ b/test/swift-files/indent/identifiers.swift @@ -109,6 +109,12 @@ func foo() { foo( some: 1 ) + foo( + nonisolated: 1 + ) + foo( + isolated: 1 + ) // Keywords used in statements foo(