From 25cf8237312bf5eddc2c90001feb8f73633ab523 Mon Sep 17 00:00:00 2001 From: taku0 Date: Sat, 17 Feb 2024 15:31:10 +0900 Subject: [PATCH] Support nonisolated(unsafe) https://github.com/apple/swift-evolution/blob/main/proposals/0412-strict-concurrency-for-global-variables.md --- swift-mode-lexer.el | 4 ++-- test/swift-files/indent/declarations.swift | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/swift-mode-lexer.el b/swift-mode-lexer.el index 080a904..c826ee2 100644 --- a/swift-mode-lexer.el +++ b/swift-mode-lexer.el @@ -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 @@ -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. diff --git a/test/swift-files/indent/declarations.swift b/test/swift-files/indent/declarations.swift index 2c8a304..abd004c 100644 --- a/test/swift-files/indent/declarations.swift +++ b/test/swift-files/indent/declarations.swift @@ -804,6 +804,14 @@ class Foo { package func foo() { } + + func foo() async { + nonisolated + ( + unsafe + ) + var x = 1 + } } // async let