You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Changelog.md
+17-9Lines changed: 17 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -4,19 +4,27 @@ Note: This is in reverse chronological order, so newer entries are added to the
4
4
5
5
## Swift 5.2
6
6
7
+
-`ReversedSyntaxChildren` has been removed
8
+
9
+
Use the `reversed()` property on `SyntaxCollection`, which now conforms to `BidirectionalCollection` instead.
10
+
11
+
-`SyntaxCollection`s now conform to `BidirectionalCollection`
12
+
13
+
The previous conformance to `Sequence` has been upgraded to a conformance to `BidirectionalCollection`
14
+
7
15
- Properties `isExpr`, `isDecl`, `isStmt`, `isType` and `isPattern` removed from `SyntaxNode`
8
16
9
17
Use `is(ExprSyntaxProtocol.self)` etc. instead.
10
18
11
-
- Property `uniqueIdentifier` removed from syntax nodes and `SyntaxNode` ([#164](https://github.com/apple/swift-syntax/pull/164))
19
+
- Property `uniqueIdentifier` removed from syntax nodes and `SyntaxNode`
12
20
13
21
Use the newly added property `id` or the conformance to `Identifiable` instead.
14
22
15
-
- Syntax nodes and `SyntaxNode` conform to `Identifiable` ([#164](https://github.com/apple/swift-syntax/pull/164))
23
+
- Syntax nodes and `SyntaxNode` conform to `Identifiable`
16
24
17
25
`Identifiable` conformance has been added to all syntax nodes and the `SyntaxNode` type using `SyntaxIdentifier` as the identifier.
18
26
19
-
- The `walk` method on syntax nodes has been removed. ([#158](https://github.com/apple/swift-syntax/pull/158))
27
+
- The `walk` method on syntax nodes has been removed.
20
28
21
29
Instead, use the `walk` method on the `SyntaxVisitor`.
22
30
@@ -28,7 +36,7 @@ Note: This is in reverse chronological order, so newer entries are added to the
28
36
visitor.walk(tree)
29
37
```
30
38
31
-
-`SyntaxVisitor` and `SyntaxAnyVisitor` are a `class` and no longer a `protocol`. ([#158](https://github.com/apple/swift-syntax/pull/158))
39
+
-`SyntaxVisitor` and `SyntaxAnyVisitor` are a `class` and no longer a `protocol`.
32
40
33
41
For performance reasons the `SyntaxVisitor` and `SyntaxAnyVisitor` were migrated from being a protocol to being a class.
34
42
@@ -50,7 +58,7 @@ Note: This is in reverse chronological order, so newer entries are added to the
50
58
}
51
59
```
52
60
53
-
- A new type `SyntaxEnum` has been introduced ([#155](https://github.com/apple/swift-syntax/pull/155))
61
+
- A new type `SyntaxEnum` has been introduced
54
62
55
63
The new type `SyntaxEnum` allow exhaustive switching over all syntax types. It can be constructed by calling `asSyntaxEnum` on `Syntax`.
56
64
@@ -68,7 +76,7 @@ Note: This is in reverse chronological order, so newer entries are added to the
68
76
69
77
For increased performance, the modelling of the syntax node hierarchy has been switched from being `protocol`-based to being `struct`-based. This includes the following changes:
70
78
71
-
- The protocols `ExprSyntax`, `DeclSyntax`, `Syntax` etc. have been removed. ([#155](https://github.com/apple/swift-syntax/pull/155))
79
+
- The protocols `ExprSyntax`, `DeclSyntax`, `Syntax` etc. have been removed
72
80
73
81
For passing values of these types around, use the new type erasers `ExprSyntax`, `DeclSyntax`, `Syntax` etc. instead. To add computed properties or functions to all expression nodes, write an extension on `ExprSyntaxProtocol`. To add methods to all syntax nodes, extend `SyntaxProtcol`.
74
82
@@ -95,7 +103,7 @@ For increased performance, the modelling of the syntax node hierarchy has been s
95
103
```
96
104
97
105
98
-
- Checking a node's type can no longer be performed using the `is` operator. Use the `is(_: SyntaxProtocol)` method on any type eraser instead. ([#155](https://github.com/apple/swift-syntax/pull/155))
106
+
- Checking a node's type can no longer be performed using the `is` operator. Use the `is(_: SyntaxProtocol)` method on any type eraser instead.
99
107
100
108
```swift
101
109
// Before
@@ -115,7 +123,7 @@ For increased performance, the modelling of the syntax node hierarchy has been s
115
123
```
116
124
117
125
118
-
- Downcasting can no longer be performed using the `as` operator. For downcasting use the `as(_: SyntaxProtocol)` method on any type eraser. ([#155](https://github.com/apple/swift-syntax/pull/155))
126
+
- Downcasting can no longer be performed using the `as` operator. For downcasting use the `as(_: SyntaxProtocol)` method on any type eraser.
119
127
120
128
```swift
121
129
// Before
@@ -125,7 +133,7 @@ For increased performance, the modelling of the syntax node hierarchy has been s
125
133
exprSyntax.as(IdentifierExprSyntax.self)
126
134
```
127
135
128
-
- Upcasting needs to be performed explicitly. Use the designated initializers for this. ([#155](https://github.com/apple/swift-syntax/pull/155))
136
+
- Upcasting needs to be performed explicitly. Use the designated initializers for this.
0 commit comments