Skip to content

Commit d0731f1

Browse files
committed
Add migration steps for all deprecations and API-incompatible changes
This should make it easier for clients to migrate to new versions of swift-syntax.
1 parent b73118c commit d0731f1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Release Notes/511.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,37 +24,44 @@
2424
- Description: `is`, `as`, and `cast` methods for types not contained in the choice node are marked as deprecated. The deprecated methods will emit a warning, indicating that the cast will always fail.
2525
- Issue: https://github.com/apple/swift-syntax/issues/2092
2626
- Pull Request: https://github.com/apple/swift-syntax/pull/2184
27+
- Migration steps: Remove the `is`, `as` or `cast` methods because they will always fail.
2728

2829
- `IncrementalParseTransition`:
2930
- Description: The initializer `IncrementalParseTransition.init(previousTree:edits:lookaheadRanges:reusedNodeCallback:)` is marked as deprecated. Use `IncrementalParseTransition.init(previousIncrementalParseResult:edits:reusedNodeCallback:)` instead.
3031
- Issue: https://github.com/apple/swift-syntax/issues/2267
3132
- Pull request: https://github.com/apple/swift-syntax/pull/2272
33+
- Migration steps: Call `IncrementalParseTransition.init(previousIncrementalParseResult:edits:reusedNodeCallback:)` instead.
3234

3335
## API-Incompatible Changes
3436

3537
- Effect specifiers:
3638
- Description: The `unexpectedAfterThrowsSpecifier` node of the various effect specifiers has been removed.
3739
- Pull request: https://github.com/apple/swift-syntax/pull/2219
40+
- Migration steps: Check `unexpectedBetweenThrowsSpecifierAndThrownError` and `unexpectedAfterThrownError` instead.
3841

3942
- `SyntaxKind` removed conformance to `CaseIterable`
4043
- Description: `SyntaxKind` no longer conforms to `CaseIterable` since there is no good use case to iterate over all syntax kinds.
41-
- Pull request: https://github.com/apple/swift-syntax/pull/2292
44+
- Pull request: https://github.com/apple/swift-syntax/pull/2292
45+
- Migration steps: Exhaustively check all the syntax nodes that your program supports. There should be no use case to iterate over all cases in `SyntaxKind`.
4246

4347
- `IntegerLiteralExprSyntax.Radix` removed conformance to `CaseIterable`
4448
- Description: `IntegerLiteralExprSyntax.Radix` no longer conforms to `CaseIterable` since there is no good use case to iterate over all radix kinds.
4549
- Pull request: https://github.com/apple/swift-syntax/pull/2292
50+
- Migration steps: There should be no use case to iterate over all cases in `IntegerLiteralExprSyntax.Radix`.
4651

4752
- `Parser.parseIncrementally(source:parseTransition:)` and `Parser.parseIncrementally(source:maximumNestingLevel:parseTransition:)`:
4853
- Description: The default versions of `Parser.parseIncrementally` return a `IncrementalParseResult` instead of a tuple. Access to the struct should be compatible with the tuple in almost all cases unless the tuple is stored into a variable and then destructed or passed to a function that expects a tuple.
4954
- Issue: https://github.com/apple/swift-syntax/issues/2267
5055
- Pull request: https://github.com/apple/swift-syntax/pull/2272
56+
- Migration steps: If necessary, change type annotations from the tuple to the `IncrementalParseResult` type.
5157

5258
## Template
5359

5460
- *Affected API or two word description*
5561
- Description: *A 1-2 sentence description of the new/modified API*
5662
- Issue: *If an issue exists for this change, a link to the issue*
5763
- Pull Request: *Link to the pull request(s) that introduces this change*
64+
- Migration steps: Steps that adopters of swift-syntax should take to move to the new API (required for deprecations and API-incompatible changes).
5865
- Notes: *In case of deprecations or API-incompatible changes, the reason why this change was made and the suggested alternative*
5966

6067
*Insert entries in chronological order, with newer entries at the bottom*

0 commit comments

Comments
 (0)