@@ -13,14 +13,25 @@ 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 (Swift 5.7 and earlier)
16
+ ## Matching swift-format to Your Swift Version
17
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.
18
+ ### Swift 5.8 and later
19
+
20
+ As of Swift 5.8, swift-format depends on the version of
21
+ [ SwiftSyntax] ( https://github.com/apple/swift-syntax ) whose parser has been
22
+ rewritten in Swift and no longer has dependencies on libraries in the
23
+ Swift toolchain.
24
+
25
+ This change allows ` swift-format ` to be built, developed, and run using
26
+ any version of Swift that can compile it, decoupling it from the version
27
+ that supported a particular syntax. However, earlier versions of swift-format
28
+ will still not be able to recognize new syntax added in later versions of the
29
+ language and parser.
30
+
31
+ Note also that the version numbering scheme has changed to match
32
+ SwiftSyntax; the 5.8 release of swift-format is ` 508.0.0 ` , not ` 0.50800.0 ` .
33
+
34
+ ### Swift 5.7 and earlier
24
35
25
36
` swift-format ` versions 0.50700.0 and earlier depend on versions of
26
37
[ SwiftSyntax] ( https://github.com/apple/swift-syntax ) that used a standalone
@@ -54,7 +65,7 @@ then once you have identified the version you need, you can check out the
54
65
source and build it using the following commands:
55
66
56
67
``` sh
57
- VERSION=0.50700 .0 # replace this with the version you need
68
+ VERSION=508.0 .0 # replace this with the version you need
58
69
git clone https://github.com/apple/swift-format.git
59
70
cd swift-format
60
71
git checkout " tags/$VERSION "
0 commit comments