liamnichols/xcstrings-tool

Add public for package

Closed this issue · 2 comments

When I setup XCSTRINGS_TOOL_ACCESS_LEVEL_PUBLIC for my LocalizationKit package. I can't get access for generated extension.

How fix

func generateLocalizedStringResourceExtension() -> ExtensionDeclSyntax {
        ExtensionDeclSyntax(
            attributes: [
                .attribute(.init(availability: .wwdc2022))
                    .with(\.trailingTrivia, .newline)
            ],
            modifiers: [
                DeclModifierSyntax(name: .keyword(.public)) <======= Need add for access from other package 
            ],
            extendedType: IdentifierTypeSyntax(name: "LocalizedStringResource"),

Hi @Vitalik13! Please can you share some more details about the issue that you are seeing? IIRC, the extension itself shouldn't need the public modifier because the property and struct within will have it instead.

You can see the complete generated code here: https://github.com/liamnichols/xcstrings-tool/blob/main/Tests/XCStringsToolTests/__Snapshots__/GenerateTests/testGenerateWithPublicAccessLevel.Localizable.swift

I double checked and updated the demo project to confirm as well: liamnichols/xcstrings-tool-demo@f7d7841

Does this help you?

I'm going to close this for now as I don't think there is anything to be fixed, but if the above doesn't help then please reopen the issue. Thanks!