@@ -13,11 +13,19 @@ invoked via an [API](#api-usage).
13
13
> and the code is provided so that it can be tested on real-world code and
14
14
> experiments can be made by modifying it.
15
15
16
- ## Matching swift-format to Your Swift Version
17
-
18
- ` swift-format ` depends on [ SwiftSyntax] ( https://github.com/apple/swift-syntax )
19
- and the standalone parsing library that is distributed as part of the Swift
20
- toolchain, so you should check out and build ` swift-format ` from the release
16
+ ## Matching swift-format to Your Swift Version (Swift 5.7 and earlier)
17
+
18
+ > NOTE: ` swift-format ` on the ` main ` branch now uses a version of
19
+ > [ SwiftSyntax] ( https://github.com/apple/swift-syntax ) whose parser has been
20
+ > rewritten in Swift and no longer has dependencies on libraries in the
21
+ > Swift toolchain. This allows ` swift-format ` to be built, developed, and
22
+ > run using any version of Swift that can compile it, decoupling it from
23
+ > the version that supported a particular syntax.
24
+
25
+ ` swift-format ` versions 0.50700.0 and earlier depend on versions of
26
+ [ SwiftSyntax] ( https://github.com/apple/swift-syntax ) that used a standalone
27
+ parsing library distributed as part of the Swift toolchain. When using these
28
+ versions, you should check out and build ` swift-format ` from the release
21
29
tag or branch that is compatible with the version of Swift you are using.
22
30
23
31
The major and minor version components of ` swift-format ` and SwiftSyntax must
@@ -28,6 +36,7 @@ Swift toolchain that is installed and used to build and run the formatter:
28
36
| Xcode Release | Swift Version | ` swift-format ` Branch / Tags |
29
37
| :----------------| :-----------------------| :---------------------------------|
30
38
| – | Swift at ` main ` | ` main ` |
39
+ | Xcode 14.0 | Swift 5.7 | ` release/5.7 ` / ` 0.50700.x ` |
31
40
| Xcode 13.3 | Swift 5.6 | ` release/5.6 ` / ` 0.50600.x ` |
32
41
| Xcode 13.0–13.2 | Swift 5.5 | ` swift-5.5-branch ` / ` 0.50500.x ` |
33
42
| Xcode 12.5 | Swift 5.4 | ` swift-5.4-branch ` / ` 0.50400.x ` |
@@ -45,7 +54,7 @@ then once you have identified the version you need, you can check out the
45
54
source and build it using the following commands:
46
55
47
56
``` sh
48
- VERSION=0.50600 .0 # replace this with the version you need
57
+ VERSION=0.50700 .0 # replace this with the version you need
49
58
git clone https://github.com/apple/swift-format.git
50
59
cd swift-format
51
60
git checkout " tags/$VERSION "
0 commit comments