Skip to content

Commit 86783bd

Browse files
authored
Merge pull request #2349 from ahoppen/ahoppen/migration/steps
Add migration steps for all deprecations and API-incompatible changes
2 parents 1c7f5bf + d0731f1 commit 86783bd

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,11 +24,13 @@
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
- `MacroExpansion{Error|Warning|FixIt}Message` moved to the `SwiftSyntaxMacros` module
3436
- Description: Move the `MacroExpansion{Error|Warning|FixIt}Message` types from the `SwiftSyntaxMacroExpansion` module to `SwiftSyntaxMacros`. Deprecated typealiases in `SwiftSyntaxMacroExpansion` forward to `SwiftSyntaxMacros`.
@@ -40,26 +42,31 @@
4042
- Effect specifiers:
4143
- Description: The `unexpectedAfterThrowsSpecifier` node of the various effect specifiers has been removed.
4244
- Pull request: https://github.com/apple/swift-syntax/pull/2219
45+
- Migration steps: Check `unexpectedBetweenThrowsSpecifierAndThrownError` and `unexpectedAfterThrownError` instead.
4346

4447
- `SyntaxKind` removed conformance to `CaseIterable`
4548
- Description: `SyntaxKind` no longer conforms to `CaseIterable` since there is no good use case to iterate over all syntax kinds.
46-
- Pull request: https://github.com/apple/swift-syntax/pull/2292
49+
- Pull request: https://github.com/apple/swift-syntax/pull/2292
50+
- 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`.
4751

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

5257
- `Parser.parseIncrementally(source:parseTransition:)` and `Parser.parseIncrementally(source:maximumNestingLevel:parseTransition:)`:
5358
- 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.
5459
- Issue: https://github.com/apple/swift-syntax/issues/2267
5560
- Pull request: https://github.com/apple/swift-syntax/pull/2272
61+
- Migration steps: If necessary, change type annotations from the tuple to the `IncrementalParseResult` type.
5662

5763
## Template
5864

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

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

0 commit comments

Comments
 (0)