From 9ff9c8d330c6e153ad3ee9d073564955420d821a Mon Sep 17 00:00:00 2001 From: "Henrik G. Olsson" Date: Thu, 25 Sep 2025 17:02:09 -0700 Subject: [PATCH 1/2] [Swiftify] add Package.swift to enable LSP --- lib/Macros/Package.swift | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 lib/Macros/Package.swift diff --git a/lib/Macros/Package.swift b/lib/Macros/Package.swift new file mode 100644 index 0000000000000..2542a5a360456 --- /dev/null +++ b/lib/Macros/Package.swift @@ -0,0 +1,46 @@ +// swift-tools-version: 6.2 + +// Although this could in theory be used to build macros, it's not actually wired up to CMake. +// This is here purely to provide LSP IDE features when working on Swift macros. + +import PackageDescription +import CompilerPluginSupport + +let package = Package( + name: "SwiftifyImport", + platforms: [.macOS(.v11)], + products: [ + .library( + name: "SwiftifyImport", + targets: [ + "SwiftifyImport" + ] + ), + .library( + name: "SwiftifyImportMacro", + targets: [ + "SwiftifyImportMacro" + ] + ) + ], + dependencies: [ + .package(path: "../../../swift-syntax") + ], + targets: [ + .macro( + name: "SwiftifyImportMacro", + dependencies: [ + .product(name: "SwiftCompilerPlugin", package: "swift-syntax"), + .product(name: "SwiftDiagnostics", package: "swift-syntax"), + .product(name: "SwiftParser", package: "swift-syntax"), + .product(name: "SwiftSyntax", package: "swift-syntax"), + .product(name: "SwiftSyntaxBuilder", package: "swift-syntax"), + .product(name: "SwiftSyntaxMacro", package: "swift-syntax") + ] + ), + .target( + name: "SwiftifyImport", + dependencies: ["SwiftifyImportMacro"] + ) + ] +) From a3e81ceef3f8a39bcb4a7e52030df8ec73539de1 Mon Sep 17 00:00:00 2001 From: "Henrik G. Olsson" Date: Fri, 26 Sep 2025 10:45:19 -0700 Subject: [PATCH 2/2] add more platforms (why not?) --- lib/Macros/Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Macros/Package.swift b/lib/Macros/Package.swift index 2542a5a360456..b673dbdf709c9 100644 --- a/lib/Macros/Package.swift +++ b/lib/Macros/Package.swift @@ -8,7 +8,7 @@ import CompilerPluginSupport let package = Package( name: "SwiftifyImport", - platforms: [.macOS(.v11)], + platforms: [.macOS(.v11), .iOS(.v15), .tvOS(.v15), .watchOS(.v8)], products: [ .library( name: "SwiftifyImport",