diff --git a/Package.swift b/Package.swift index 494734a7a7a..69554dc6d70 100644 --- a/Package.swift +++ b/Package.swift @@ -457,6 +457,14 @@ package.targets.append( ) ) +// MARK: - Apply upcoming feature flags to all targets + +for target in package.targets { + var settings = target.swiftSettings ?? [] + settings.append(.enableUpcomingFeature("MemberImportVisibility")) + target.swiftSettings = settings +} + // MARK: - Parse build arguments func hasEnvironmentVariable(_ name: String) -> Bool { diff --git a/Sources/SwiftCompilerPluginMessageHandling/Diagnostics.swift b/Sources/SwiftCompilerPluginMessageHandling/Diagnostics.swift index 277212cd08c..51dad1f9b95 100644 --- a/Sources/SwiftCompilerPluginMessageHandling/Diagnostics.swift +++ b/Sources/SwiftCompilerPluginMessageHandling/Diagnostics.swift @@ -13,9 +13,11 @@ #if compiler(>=6) internal import SwiftDiagnostics internal import SwiftSyntax +internal import SwiftSyntaxMacros #else import SwiftDiagnostics import SwiftSyntax +import SwiftSyntaxMacros #endif /// Errors in macro handing. diff --git a/Sources/SwiftIfConfig/IfConfigEvaluation.swift b/Sources/SwiftIfConfig/IfConfigEvaluation.swift index 8b2bad12001..993ed1b896d 100644 --- a/Sources/SwiftIfConfig/IfConfigEvaluation.swift +++ b/Sources/SwiftIfConfig/IfConfigEvaluation.swift @@ -13,6 +13,7 @@ import SwiftDiagnostics import SwiftOperators @_spi(RawSyntax) import SwiftSyntax +import SwiftSyntaxBuilder /// Evaluate the condition of an `#if`. /// - Parameters: diff --git a/Sources/SwiftParserDiagnostics/ParseDiagnosticsGenerator.swift b/Sources/SwiftParserDiagnostics/ParseDiagnosticsGenerator.swift index 8ddf99358b1..783ca2c7f2a 100644 --- a/Sources/SwiftParserDiagnostics/ParseDiagnosticsGenerator.swift +++ b/Sources/SwiftParserDiagnostics/ParseDiagnosticsGenerator.swift @@ -11,10 +11,12 @@ //===----------------------------------------------------------------------===// #if compiler(>=6) +internal import SwiftBasicFormat public import SwiftDiagnostics @_spi(Diagnostics) internal import SwiftParser @_spi(ExperimentalLanguageFeatures) public import SwiftSyntax #else +import SwiftBasicFormat import SwiftDiagnostics @_spi(Diagnostics) import SwiftParser @_spi(ExperimentalLanguageFeatures) import SwiftSyntax diff --git a/Sources/SwiftRefactor/ConvertComputedPropertyToStored.swift b/Sources/SwiftRefactor/ConvertComputedPropertyToStored.swift index f2c14b7378e..848d4d0c599 100644 --- a/Sources/SwiftRefactor/ConvertComputedPropertyToStored.swift +++ b/Sources/SwiftRefactor/ConvertComputedPropertyToStored.swift @@ -12,8 +12,10 @@ #if compiler(>=6) public import SwiftSyntax +public import SwiftSyntaxBuilder #else import SwiftSyntax +import SwiftSyntaxBuilder #endif public struct ConvertComputedPropertyToStored: SyntaxRefactoringProvider { diff --git a/Sources/SwiftRefactor/ConvertStoredPropertyToComputed.swift b/Sources/SwiftRefactor/ConvertStoredPropertyToComputed.swift index 179b6c5b600..fcc5da407cf 100644 --- a/Sources/SwiftRefactor/ConvertStoredPropertyToComputed.swift +++ b/Sources/SwiftRefactor/ConvertStoredPropertyToComputed.swift @@ -12,8 +12,10 @@ #if compiler(>=6) public import SwiftSyntax +public import SwiftSyntaxBuilder #else import SwiftSyntax +import SwiftSyntaxBuilder #endif public struct ConvertStoredPropertyToComputed: SyntaxRefactoringProvider { diff --git a/Sources/SwiftRefactor/ConvertZeroParameterFunctionToComputedProperty.swift b/Sources/SwiftRefactor/ConvertZeroParameterFunctionToComputedProperty.swift index 27f8c02b08e..b8a66af9c51 100644 --- a/Sources/SwiftRefactor/ConvertZeroParameterFunctionToComputedProperty.swift +++ b/Sources/SwiftRefactor/ConvertZeroParameterFunctionToComputedProperty.swift @@ -13,9 +13,11 @@ #if compiler(>=6) public import SwiftSyntax import SwiftBasicFormat +import SwiftSyntaxBuilder #else import SwiftSyntax import SwiftBasicFormat +import SwiftSyntaxBuilder #endif public struct ConvertZeroParameterFunctionToComputedProperty: SyntaxRefactoringProvider { diff --git a/Sources/SwiftRefactor/PackageManifest/ManifestSyntaxRepresentable.swift b/Sources/SwiftRefactor/PackageManifest/ManifestSyntaxRepresentable.swift index 00e35dd00ea..e4655b4be63 100644 --- a/Sources/SwiftRefactor/PackageManifest/ManifestSyntaxRepresentable.swift +++ b/Sources/SwiftRefactor/PackageManifest/ManifestSyntaxRepresentable.swift @@ -11,6 +11,7 @@ //===----------------------------------------------------------------------===// import SwiftSyntax +import SwiftSyntaxBuilder /// Describes an entity in the package model that can be represented as /// a syntax node. diff --git a/Sources/SwiftRefactor/PackageManifest/PackageTarget.swift b/Sources/SwiftRefactor/PackageManifest/PackageTarget.swift index 5c12ba32eef..c3374738ebf 100644 --- a/Sources/SwiftRefactor/PackageManifest/PackageTarget.swift +++ b/Sources/SwiftRefactor/PackageManifest/PackageTarget.swift @@ -11,6 +11,7 @@ //===----------------------------------------------------------------------===// import SwiftSyntax +import SwiftSyntaxBuilder /// Syntactic wrapper type that describes a target for refactoring /// purposes but does not interpret its contents. diff --git a/Sources/SwiftRefactor/PackageManifest/ProductDescription.swift b/Sources/SwiftRefactor/PackageManifest/ProductDescription.swift index 1bf34d317eb..cd660bf0a6e 100644 --- a/Sources/SwiftRefactor/PackageManifest/ProductDescription.swift +++ b/Sources/SwiftRefactor/PackageManifest/ProductDescription.swift @@ -11,6 +11,7 @@ //===----------------------------------------------------------------------===// import SwiftSyntax +import SwiftSyntaxBuilder /// Syntactic wrapper type that describes a product for refactoring /// purposes but does not interpret its contents. diff --git a/Sources/SwiftRefactor/PackageManifest/SyntaxEditUtils.swift b/Sources/SwiftRefactor/PackageManifest/SyntaxEditUtils.swift index 2f1abdb3a0c..cb739903230 100644 --- a/Sources/SwiftRefactor/PackageManifest/SyntaxEditUtils.swift +++ b/Sources/SwiftRefactor/PackageManifest/SyntaxEditUtils.swift @@ -13,6 +13,7 @@ import SwiftBasicFormat import SwiftParser import SwiftSyntax +import SwiftSyntaxBuilder /// Default indent when we have to introduce indentation but have no context /// to get it right. diff --git a/Sources/SwiftSyntaxMacroExpansion/IndentationUtils.swift b/Sources/SwiftSyntaxMacroExpansion/IndentationUtils.swift index b7ddfc6119b..786d2f35a2d 100644 --- a/Sources/SwiftSyntaxMacroExpansion/IndentationUtils.swift +++ b/Sources/SwiftSyntaxMacroExpansion/IndentationUtils.swift @@ -11,8 +11,10 @@ //===----------------------------------------------------------------------===// #if compiler(>=6) +internal import SwiftBasicFormat internal import SwiftSyntax #else +import SwiftBasicFormat import SwiftSyntax #endif diff --git a/Sources/SwiftSyntaxMacroExpansion/MacroExpansion.swift b/Sources/SwiftSyntaxMacroExpansion/MacroExpansion.swift index 9482ce38f6e..f8c9cab4497 100644 --- a/Sources/SwiftSyntaxMacroExpansion/MacroExpansion.swift +++ b/Sources/SwiftSyntaxMacroExpansion/MacroExpansion.swift @@ -11,9 +11,9 @@ //===----------------------------------------------------------------------===// #if compiler(>=6) -import SwiftBasicFormat -import SwiftDiagnostics -import SwiftIfConfig +internal import SwiftBasicFormat +internal import SwiftDiagnostics +internal import SwiftIfConfig public import SwiftSyntax @_spi(MacroExpansion) @_spi(ExperimentalLanguageFeatures) public import SwiftSyntaxMacros #else diff --git a/Sources/SwiftSyntaxMacroExpansion/MacroSpec.swift b/Sources/SwiftSyntaxMacroExpansion/MacroSpec.swift index fcad671f964..21d87b07a9d 100644 --- a/Sources/SwiftSyntaxMacroExpansion/MacroSpec.swift +++ b/Sources/SwiftSyntaxMacroExpansion/MacroSpec.swift @@ -12,9 +12,11 @@ #if compiler(>=6) public import SwiftSyntax +internal import SwiftSyntaxBuilder public import SwiftSyntaxMacros #else import SwiftSyntax +import SwiftSyntaxBuilder import SwiftSyntaxMacros #endif diff --git a/Sources/SwiftSyntaxMacroExpansion/MacroSystem.swift b/Sources/SwiftSyntaxMacroExpansion/MacroSystem.swift index d3b356106c5..732fcfd86cc 100644 --- a/Sources/SwiftSyntaxMacroExpansion/MacroSystem.swift +++ b/Sources/SwiftSyntaxMacroExpansion/MacroSystem.swift @@ -11,6 +11,7 @@ //===----------------------------------------------------------------------===// #if compiler(>=6) +internal import SwiftBasicFormat internal import SwiftDiagnostics internal import SwiftOperators @_spi(MacroExpansion) internal import SwiftParser @@ -18,6 +19,7 @@ internal import SwiftOperators internal import SwiftSyntaxBuilder @_spi(MacroExpansion) @_spi(ExperimentalLanguageFeatures) public import SwiftSyntaxMacros #else +import SwiftBasicFormat import SwiftDiagnostics import SwiftOperators @_spi(MacroExpansion) import SwiftParser