Skip to content
Open
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
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ Do not forget about target dependencies:

> [!TIP]
>
> _You can extend compatibility by supporting multiple [`swift-syntax`](https://github.com/swiftlang/swift-syntax) versions_
> _You can extend compatibility of your libraries by supporting multiple [`swift-syntax`](https://github.com/swiftlang/swift-syntax) versions_
>
> ```swift
> .package(
Expand All @@ -384,3 +384,10 @@ Do not forget about target dependencies:
> | `0.6.0` | `600.0.0` |
> | `0.7.0` | `601.0.0` |
> | `0.8.0` | `602.0.0` |
>
> _It is also possible to use local [`swift-syntax`](https://github.com/swiftlang/swift-syntax) overrides if some other dependency pervents you from depending on newer [`swift-macro-toolkit`](https://github.com/stackotter/swift-macro-toolkit) version and vice versa. It requires cloning [`swift-syntax`](https://github.com/swiftlang/swift-syntax) into a local directory and depending your app on the local clone. Usually [`swift-syntax`](https://github.com/swiftlang/swift-syntax) updates don't break macros_ 💁‍♂️
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: pervents (meant to be prevents I believe)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... into a local directory and updating your app to depend on the local clone. This will force SwiftPM to use your local clone of swift-syntax throughout the whole package graph, allowing you to bypass conflicting version requirements. Note that this may fail if some macros depend on newer/older API variants. Usually swift-syntax...

>
> ```swift
> .package(path: "<path-to-local-swift-syntax>")
> ```