|
35 | 35 | - `String.isValidIdentifier(for:)` |
36 | 36 | - Description: `SwiftParser` adds an extension on `String` to check if it can be used as an identifier in a given context. |
37 | 37 | - Pull Request: https://github.com/apple/swift-syntax/pull/2434 |
38 | | - |
| 38 | + |
39 | 39 | - `MacroDeclSyntax.expand` |
40 | 40 | - the `expand(argumentList:definition:replacements:)` method gains a new parameter 'genericReplacements:' that is defaulted to an empty array. |
41 | 41 | - The method's signature is now `expand(argumentList:definition:replacements:genericReplacements:)` |
|
65 | 65 | - Type specifiers |
66 | 66 | - Description: `AttributedTypeSyntax` can now contain multiple specifiers and these types are used to model the list of specifiers. Additionally, type specifiers can now contain arguments, like `borrow(data)`. To facilitate this, the following new types were introduces: `LifetimeSpecifierArgumentListSyntax`, `LifetimeSpecifierArgumentSyntax`, `LifetimeSpecifierArgumentsSyntax`, `LifetimeTypeSpecifierSyntax`, `SimpleTypeSpecifierSyntax`, `TypeSpecifierListSyntax` |
67 | 67 | - Pull request: https://github.com/apple/swift-syntax/pull/2433 |
68 | | - |
| 68 | + |
| 69 | +- `DeclGroupSyntax.introducer` |
| 70 | + - Description: The `DeclGroupSyntax` trait has an extra `introducer` property, ie. the keyword that introduces the declaration. |
| 71 | + - Issue: https://github.com/apple/sourcekit-lsp/issues/2535 |
| 72 | + - Pull Request: https://github.com/apple/swift-syntax/pull/2539 |
| 73 | + |
69 | 74 | ## API Behavior Changes |
70 | 75 |
|
71 | 76 | ## Deprecations |
72 | | - |
| 77 | + |
73 | 78 | - Child Choice Node Casts |
74 | 79 | - 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. |
75 | 80 | - Issue: https://github.com/apple/swift-syntax/issues/2092 |
|
85 | 90 | - `MacroExpansion{Error|Warning|FixIt}Message` moved to the `SwiftSyntaxMacros` module |
86 | 91 | - Description: Move the `MacroExpansion{Error|Warning|FixIt}Message` types from the `SwiftSyntaxMacroExpansion` module to `SwiftSyntaxMacros`. Deprecated typealiases in `SwiftSyntaxMacroExpansion` forward to `SwiftSyntaxMacros`. |
87 | 92 | - Pull request: https://github.com/apple/swift-syntax/pull/2338 |
88 | | - - Notes: The expansion diagnostic messages were defined in `SwiftSyntaxMacroExpansion`, which is intended as an implementation detail of the plugin server and should not need to be imported by macros. |
| 93 | + - Notes: The expansion diagnostic messages were defined in `SwiftSyntaxMacroExpansion`, which is intended as an implementation detail of the plugin server and should not need to be imported by macros. |
89 | 94 |
|
90 | 95 | - `EditorPlaceholderDeclSyntax` and `EditorPlaceholderExprSyntax`: |
91 | 96 | - Description: `EditorPlaceholderDeclSyntax` and `EditorPlaceholderExprSyntax` are now deprecated and placeholders are instead parsed as identifiers within a `MissingDeclSyntax` or `DeclReferenceExprSyntax`. |
|
105 | 110 | - Effect specifiers: |
106 | 111 | - Description: The `unexpectedAfterThrowsSpecifier` node of the various effect specifiers has been removed. |
107 | 112 | - Pull request: https://github.com/apple/swift-syntax/pull/2219 |
108 | | - - Migration steps: Check `unexpectedBetweenThrowsSpecifierAndThrownError` and `unexpectedAfterThrownError` instead. |
| 113 | + - Migration steps: Check `unexpectedBetweenThrowsSpecifierAndThrownError` and `unexpectedAfterThrownError` instead. |
109 | 114 |
|
110 | 115 | - `SyntaxKind` removed conformance to `CaseIterable` |
111 | | - - Description: `SyntaxKind` no longer conforms to `CaseIterable` since there is no good use case to iterate over all syntax kinds. |
112 | | - - Pull request: https://github.com/apple/swift-syntax/pull/2292 |
| 116 | + - Description: `SyntaxKind` no longer conforms to `CaseIterable` since there is no good use case to iterate over all syntax kinds. |
| 117 | + - Pull request: https://github.com/apple/swift-syntax/pull/2292 |
113 | 118 | - 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`. |
114 | 119 |
|
115 | 120 | - `IntegerLiteralExprSyntax.Radix` removed conformance to `CaseIterable` |
116 | | - - Description: `IntegerLiteralExprSyntax.Radix` no longer conforms to `CaseIterable` since there is no good use case to iterate over all radix kinds. |
| 121 | + - Description: `IntegerLiteralExprSyntax.Radix` no longer conforms to `CaseIterable` since there is no good use case to iterate over all radix kinds. |
117 | 122 | - Pull request: https://github.com/apple/swift-syntax/pull/2292 |
118 | 123 | - Migration steps: There should be no use case to iterate over all cases in `IntegerLiteralExprSyntax.Radix`. |
119 | 124 |
|
|
127 | 132 | - The new classification case covers the first names of parameters in function-like declarations and the label of arguments in function-like calls. |
128 | 133 | - Pull request: https://github.com/apple/swift-syntax/pull/2375 |
129 | 134 | - Migration steps: In exhaustive switches over `SyntaxClassification`, cover the new case. |
130 | | - |
| 135 | + |
131 | 136 | - `SyntaxEnum` and `SyntaxKind` gained new cases: `throwsClause` |
132 | 137 | - The new cases cover the newly introduced `ThrowsClauseSyntax` |
133 | 138 | - Pull request: https://github.com/apple/swift-syntax/pull/2379 |
|
137 | 142 | - Description: The new property provides the lexical context in which the macro is expanded, and has several paired API changes. Types that conform to `MacroExpansionContext` will need to implement this property. Additionally, the `HostToPluginMessage` cases `expandFreestandingMacro` and `expandAttachedMacro` now include an optional `lexicalContext`. Finally, the `SyntaxProtocol.expand(macros:in:indentationWidth:)` syntactic expansion operation has been deprecated in favor of a new version `expand(macros:contextGenerator:indentationWidth:)` that takes a function produces a new macro expansion context for each expansion. |
138 | 143 | - Pull request: https://github.com/apple/swift-syntax/pull/1554 |
139 | 144 | - Migration steps: Add the new property `lexicalContext` to any `MacroExpansionContext`-conforming types. If implementing the host-to-plugin message protocol, add support for `lexicalContext`. For macro expansion operations going through `SyntaxProtocol.expand`, provide a context generator that creates a fresh context including the lexical context. |
140 | | - |
| 145 | + |
141 | 146 | - `TriviaPiece.isBackslash` in `SwiftParserDiagnostics` removed |
142 | 147 | - Description: `TriviaPiece.isBackslash` was not intended to be public API. |
143 | | - - Pull request: xxx |
| 148 | + - Pull request: https://github.com/apple/swift-syntax/pull/2531 |
144 | 149 | - Migration steps: Use `if case .backslash = triviaPiece` instead |
145 | 150 |
|
146 | 151 | ## Template |
|
0 commit comments