Skip to content

Support SwiftSyntax v601 #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 23, 2025
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
28 changes: 14 additions & 14 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let package = Package(
dependencies: [
.package(url: "https://github.com/maplibre/maplibre-gl-native-distribution.git", from: "6.10.0"),
// Macros
.package(url: "https://github.com/swiftlang/swift-syntax.git", "509.0.0" ..< "601.0.0"),
.package(url: "https://github.com/swiftlang/swift-syntax.git", "509.0.0" ..< "602.0.0"),
// Testing
.package(url: "https://github.com/Kolos65/Mockable.git", from: "0.3.1"),
.package(url: "https://github.com/pointfreeco/swift-snapshot-testing", from: "1.18.3"),
Expand Down
15 changes: 15 additions & 0 deletions Sources/MapLibreSwiftMacrosImpl/StyleExpressionMacro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,22 @@
}
}

#if canImport(SwiftSyntax601)
// This provides compatibility for the new SwiftSyntax API, returning an empty result if the argument has
// been parsed as an expression.
private func generateStyleProperty(for attributes: AttributeSyntax, valueType: GenericArgumentSyntax.Argument,
isRawRepresentable: Bool) throws -> [DeclSyntax]
{
switch valueType {
case let .type(type):
try generateStyleProperty(for: attributes, valueType: type, isRawRepresentable: isRawRepresentable)
default:
[]
}
}
#endif

public struct MLNStylePropertyMacro: MemberMacro {

Check warning on line 111 in Sources/MapLibreSwiftMacrosImpl/StyleExpressionMacro.swift

View workflow job for this annotation

GitHub Actions / platform=iOS Simulator,name=iPhone 16,OS=18.1

deprecated default implementation is used to satisfy static method 'expansion(of:providingMembersOf:conformingTo:in:)' required by protocol 'MemberMacro': `MemberMacro` conformance should implement the `expansion` function that takes a `conformingTo` parameter

Check warning on line 111 in Sources/MapLibreSwiftMacrosImpl/StyleExpressionMacro.swift

View workflow job for this annotation

GitHub Actions / platform=iOS Simulator,name=iPhone 16,OS=18.1

deprecated default implementation is used to satisfy static method 'expansion(of:providingMembersOf:conformingTo:in:)' required by protocol 'MemberMacro': `MemberMacro` conformance should implement the `expansion` function that takes a `conformingTo` parameter

Check warning on line 111 in Sources/MapLibreSwiftMacrosImpl/StyleExpressionMacro.swift

View workflow job for this annotation

GitHub Actions / platform=iOS Simulator,name=iPhone 16,OS=18.1

deprecated default implementation is used to satisfy static method 'expansion(of:providingMembersOf:conformingTo:in:)' required by protocol 'MemberMacro': `MemberMacro` conformance should implement the `expansion` function that takes a `conformingTo` parameter

Check warning on line 111 in Sources/MapLibreSwiftMacrosImpl/StyleExpressionMacro.swift

View workflow job for this annotation

GitHub Actions / platform=iOS Simulator,name=iPhone 16,OS=18.1

deprecated default implementation is used to satisfy static method 'expansion(of:providingMembersOf:conformingTo:in:)' required by protocol 'MemberMacro': `MemberMacro` conformance should implement the `expansion` function that takes a `conformingTo` parameter
public static func expansion(
of node: AttributeSyntax,
providingMembersOf _: some DeclGroupSyntax,
Expand All @@ -112,7 +127,7 @@
}
}

public struct MLNRawRepresentableStylePropertyMacro: MemberMacro {

Check warning on line 130 in Sources/MapLibreSwiftMacrosImpl/StyleExpressionMacro.swift

View workflow job for this annotation

GitHub Actions / platform=iOS Simulator,name=iPhone 16,OS=18.1

deprecated default implementation is used to satisfy static method 'expansion(of:providingMembersOf:conformingTo:in:)' required by protocol 'MemberMacro': `MemberMacro` conformance should implement the `expansion` function that takes a `conformingTo` parameter

Check warning on line 130 in Sources/MapLibreSwiftMacrosImpl/StyleExpressionMacro.swift

View workflow job for this annotation

GitHub Actions / platform=iOS Simulator,name=iPhone 16,OS=18.1

deprecated default implementation is used to satisfy static method 'expansion(of:providingMembersOf:conformingTo:in:)' required by protocol 'MemberMacro': `MemberMacro` conformance should implement the `expansion` function that takes a `conformingTo` parameter

Check warning on line 130 in Sources/MapLibreSwiftMacrosImpl/StyleExpressionMacro.swift

View workflow job for this annotation

GitHub Actions / platform=iOS Simulator,name=iPhone 16,OS=18.1

deprecated default implementation is used to satisfy static method 'expansion(of:providingMembersOf:conformingTo:in:)' required by protocol 'MemberMacro': `MemberMacro` conformance should implement the `expansion` function that takes a `conformingTo` parameter

Check warning on line 130 in Sources/MapLibreSwiftMacrosImpl/StyleExpressionMacro.swift

View workflow job for this annotation

GitHub Actions / platform=iOS Simulator,name=iPhone 16,OS=18.1

deprecated default implementation is used to satisfy static method 'expansion(of:providingMembersOf:conformingTo:in:)' required by protocol 'MemberMacro': `MemberMacro` conformance should implement the `expansion` function that takes a `conformingTo` parameter
public static func expansion(
of node: AttributeSyntax,
providingMembersOf _: some DeclGroupSyntax,
Expand Down
Loading