Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Sources/TranslationCatalogIO/KeyHierarchy+Syntax.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public extension KeyHierarchy {

ExtensionDeclSyntax(
leadingTrivia: .newlines(2),
attributes: AttributeListSyntax([.attribute("@MainActor")]),
extendedType: TypeSyntax(stringLiteral: "LocalizedStringKey")
) {
let hierarchy = self
Expand Down
1 change: 1 addition & 0 deletions Sources/TranslationCatalogIO/KeyHierarchy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public struct KeyHierarchy {
"continue",
"for",
"in",
"import",
"self",
]

Expand Down
8 changes: 4 additions & 4 deletions Tests/TranslationCatalogTests/DeepKeyHierarchyTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ struct DeepKeyHierarchyTests {
#expect(syntax == """
import SwiftUI

extension LocalizedStringKey {
@MainActor extension LocalizedStringKey {

enum Payment {

Expand Down Expand Up @@ -472,7 +472,7 @@ struct DeepKeyHierarchyTests {
#expect(syntax == """
import SwiftUI

extension LocalizedStringKey {
@MainActor extension LocalizedStringKey {

enum PaymentMethod {

Expand Down Expand Up @@ -538,7 +538,7 @@ struct DeepKeyHierarchyTests {
#expect(syntax == """
import SwiftUI

extension LocalizedStringKey {
@MainActor extension LocalizedStringKey {

enum Payment {

Expand Down Expand Up @@ -586,7 +586,7 @@ struct DeepKeyHierarchyTests {
#expect(syntax == """
import SwiftUI

extension LocalizedStringKey {
@MainActor extension LocalizedStringKey {

enum PaymentMethod {
/// Are you sure you want to delete this payment method?
Expand Down
8 changes: 4 additions & 4 deletions Tests/TranslationCatalogTests/ShallowKeyHierarchyTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ struct ShallowKeyHierarchyTests {
#expect(syntax == """
import SwiftUI

extension LocalizedStringKey {
@MainActor extension LocalizedStringKey {
/// Hello World!
static let greeting: LocalizedStringKey = "GREETING"

Expand Down Expand Up @@ -327,7 +327,7 @@ struct ShallowKeyHierarchyTests {
#expect(syntax == """
import SwiftUI

extension LocalizedStringKey {
@MainActor extension LocalizedStringKey {
/// Hello World!
static let greeting: LocalizedStringKey = "GREETING"

Expand Down Expand Up @@ -375,7 +375,7 @@ struct ShallowKeyHierarchyTests {
#expect(syntax == """
import SwiftUI

extension LocalizedStringKey {
@MainActor extension LocalizedStringKey {
/// Lingua
static let applicationName: LocalizedStringKey = "APPLICATION_NAME"
/// Hello World!
Expand Down Expand Up @@ -410,7 +410,7 @@ struct ShallowKeyHierarchyTests {
#expect(syntax == """
import SwiftUI

extension LocalizedStringKey {
@MainActor extension LocalizedStringKey {
/// Lingua
static let applicationName: LocalizedStringKey = "APPLICATION_NAME"
/// Hello World!
Expand Down
Loading