510.0.0
New APIs
-
SyntaxStringInterpolation.appendInterpolation(_: (some SyntaxProtocol)?)- Description: Allows optional syntax nodes to be used inside string interpolation of syntax nodes. If the node is
nil, nothing will get added to the string interpolation. - Pull Request: #2085
- Description: Allows optional syntax nodes to be used inside string interpolation of syntax nodes. If the node is
-
SyntaxCollection.index(at:)- Description: Returns the index of the n-th element in a
SyntaxCollection. This computation is in O(n) andSyntaxCollectionis not subscriptable by an integer. - Pull Request: #2014
- Description: Returns the index of the n-th element in a
-
Convenience initializer
ClosureCaptureSyntax.init() -
Convenience initializer
EnumCaseParameterSyntax.init() -
DiagnosticSeverityandPluginMessage.Diagnostic.Severitynow have new case namedremark- Description: Remarks are used by the Swift compiler and other tools to describe some aspect of translation that doesn't reflect correctness, but may be useful for the user. Remarks have been added to the diagnostic severity enums to align with the Swift compiler.
- Pull Request: #2143
Deprecations
-
Leaf Node Casts
-
Same-Type Casts
-
Base Node Casts
-
WildcardPatternSyntax.typeAnnotation- Description:
typeAnnotationonWildcardPatternSyntaxwas a mistake. UsetypeAnnotationproperties on the outer constructs instead. E.g.PatternBindingListSyntax.typeAnnotation - Pull Request: #2393
- Description:
API-Incompatible Changes
-
NoteMessage.fixItIDrenamed tonoteID -
DiagnosticSpec.highlightreplaced byhighlights- Description: The use of a single string
highlightprevented users from asserting that a macro highlighted exactly the expected set of syntax nodes. Use ofDiagnosticSpec.init(...highlight:...)is deprecated and forwards toDiagnosticSpec.init(...highlights:...). Migrating fromhighlighttohighlightsis straightforward; any uses ofDiagnosticSpec.initwhich do not specify ahighlightdo not need to change, otherwise:- If the diagnostic highlights a single node, the
highlightstring should be replaced with a single element array containing the same string without any trailing trivia, e.g.,highlight: "let "->highlights: ["let"]. - If the diagnostic highlights multiple nodes, the
highlightstring should be replaced with an array containing an element for each highlighted node, e.g.,highlight: "struct {}"->highlights: ["struct", "{}"].
- If the diagnostic highlights a single node, the
- Pull Request: #2213
- Description: The use of a single string