chore(deps): update dependency apple/swift-syntax to v600 #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
from: "510.0.3"
->from: "600.0.0"
Release Notes
apple/swift-syntax (apple/swift-syntax)
v600.0.0
Compare Source
New APIs
FixIt now has a new computed property named
edits
edits
represent the non-overlapping textualedits
that need to be performed when the Fix-It is applied.SourceEdit
SourceEdit
has been moved from SwiftRefactor to SwiftSyntaxassertMacroExpansion
now have new parameters namedapplyFixIts
andfixedSource
applyFixIts
andfixedSource
are used to assert so ensure that the source code after applying Fix-Its matches this string.DeclSyntaxEnum
,StmtSyntaxEnum
,ExprSyntaxEnum
,TypeSyntaxEnum
, andPatternSyntaxEnum
WithOptionalCodeBlock
FunctionDeclSyntax
andInitializerDeclSyntax
.CodeBlockSyntax
CodeBlockSyntax
is nowSyntaxParseable
, so it can be used with string interpolations.ThrowsClause
throwsSpecifier
for the effects nodes (AccessorEffectSpecifiers
,FunctionEffectSpecifiers
,TypeEffectSpecifiers
,EffectSpecifiers
) has been replaced withthrowsClause
, which captures both the throws specifier and the (optional) thrown error type, as introduced by SE-0413.String.isValidSwiftIdentifier(for:)
SwiftParser
adds an extension onString
to check if it can be used as an identifier in a given context.MacroDeclSyntax.expand
expand(argumentList:definition:replacements:)
method gains a new parameter 'genericReplacements:' that is defaulted to an empty array.expand(argumentList:definition:replacements:genericReplacements:)
SyntaxProtocol.asMacroLexicalContext()
andallMacroLexicalContexts(enclosingSyntax:)
TriviaPiece.isComment
TriviaPiece
now has a computed propertyisComment
that returnstrue
if the trivia piece is a comment.New
assertMacroExpansion
API with option to specify macro specifications withmacroSpecs
argumentmacroSpecs
can have additional specifications like conformances provided by member or extension macro that can be used for macro expansion.BasicFormat.inferIndentation(of:)
IncrementalEdit
stores replacement textIncrementalEdit
used to store the range that was replaced and the length of the replacement but not the replacement bytes by itself.IncrementalEdit
now has areplacement
property that contains the replacement bytes.Type specifiers
AttributedTypeSyntax
can now contain multiple specifiers and these types are used to model the list of specifiers. Additionally, type specifiers can now contain arguments, likeborrow(data)
. To facilitate this, the following new types were introduces:LifetimeSpecifierArgumentListSyntax
,LifetimeSpecifierArgumentSyntax
,LifetimeSpecifierArgumentsSyntax
,LifetimeTypeSpecifierSyntax
,SimpleTypeSpecifierSyntax
,TypeSpecifierListSyntax
DeclGroupSyntax.introducer
DeclGroupSyntax
trait has an extraintroducer
property, ie. the keyword that introduces the declaration.ExprSyntax.interpretedAsVersionTuple
#if canImport(MyModule, _version: 1.2.3)
as a function call instead of a dedicated syntax node,1.2.3
natively gets parsed as a member access3
to the1.2
float literal. This property allows the reinterpretation of such an expression as a version tuple.SyntaxProtocol.node(at:)
SyntaxIdentifier
, returns theSyntax
node with that identifierSyntaxIdentifier.IndexInTree
SyntaxIdentifier
but does not store the root ID of the tree. It can thus be transferred across trees that are structurally equivalent, for example two copies of the same tree that live in different processes. The only public functions on this type aretoOpaque
andinit(fromOpaque:)
, which allow serialization of theIndexInTree
.SyntaxIdentifier
conformance toComparable
:SyntaxIdentifier
compares less than anotherSyntaxIdentifier
if the node at that identifier occurs first during a depth-first traversal of the tree.SyntaxIdentifier.indexInTree
andSyntaxIdentifier.fromIndexInTree
SyntaxIdentifier.indexInTree
allows the retrieval of aSyntaxIdentifier
that identifies the syntax node independent of the syntax tree.SyntaxIdentifier.fromIndexInTree
allows the creation for aSyntaxIdentifier
from a tree-agnosticSyntaxIdentifier.IndexInTree
and the tree's root node.SwiftSyntaxMacrosGenericTestSupport
SwiftSyntaxMacrosTestSupport
module that doesn't depend onFoundation
orXCTest
and can thus be used to write macro tests usingswift-testing
. Since swift-syntax can't depend on swift-testing (which would incur a circular dependency since swift-testing depends on swift-syntax), users need to manually specify a failure handler like the following, that fails the swift-testing test:Issue.record("\($0.message)", fileID: $0.location.fileID, filePath: $0.location.filePath, line: $0.location.line, column: $0.location.column)
TokenSyntax.identifier
identifier
property toTokenSyntax
which returns a canonicalized representation of an identifier that strips away backticks.Deprecations
Child Choice Node Casts
is
,as
, andcast
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.is
,as
orcast
methods because they will always fail.IncrementalParseTransition
:IncrementalParseTransition.init(previousTree:edits:lookaheadRanges:reusedNodeCallback:)
is marked as deprecated. UseIncrementalParseTransition.init(previousIncrementalParseResult:edits:reusedNodeCallback:)
instead.IncrementalParseTransition.init(previousIncrementalParseResult:edits:reusedNodeCallback:)
instead.MacroExpansion{Error|Warning|FixIt}Message
moved to theSwiftSyntaxMacros
moduleMacroExpansion{Error|Warning|FixIt}Message
types from theSwiftSyntaxMacroExpansion
module toSwiftSyntaxMacros
. Deprecated typealiases inSwiftSyntaxMacroExpansion
forward toSwiftSyntaxMacros
.SwiftSyntaxMacroExpansion
, which is intended as an implementation detail of the plugin server and should not need to be imported by macros.EditorPlaceholderDeclSyntax
andEditorPlaceholderExprSyntax
:EditorPlaceholderDeclSyntax
andEditorPlaceholderExprSyntax
are now deprecated and placeholders are instead parsed as identifiers within aMissingDeclSyntax
orDeclReferenceExprSyntax
.AttributedTypeSyntax.specifier
has renamed tospecifiers
and changed to be a collectionCanImportExprSyntax
andCanImportVersionInfoSyntax
canImport
inside#if
directives as a special expression node, parse it as a functionc call expression. This is in-line with how theswift(>=6.0)
andcompiler(>=6.0)
directives are parsed.API-Incompatible Changes
MacroDefinition
used for expanding macros:MacroDefinition/expansion
enum case used to have two values ((MacroExpansionExprSyntax, replacements: [Replacement])
), has now gained another value in order to support generic argument replacements in macro expansions:(MacroExpansionExprSyntax, replacements: [Replacement], genericReplacements: [GenericArgumentReplacement])
case .expansion(let node, let replacements, let genericReplacements):
. Creating the.extension
gained a compatibility shim, retaining the previous syntax source compatible (return .expansion(node, replacements: [])
).Effect specifiers:
unexpectedAfterThrowsSpecifier
node of the various effect specifiers has been removed.unexpectedBetweenThrowsSpecifierAndThrownError
andunexpectedAfterThrownError
instead.SyntaxKind
removed conformance toCaseIterable
SyntaxKind
no longer conforms toCaseIterable
since there is no good use case to iterate over all syntax kinds.SyntaxKind
.IntegerLiteralExprSyntax.Radix
removed conformance toCaseIterable
IntegerLiteralExprSyntax.Radix
no longer conforms toCaseIterable
since there is no good use case to iterate over all radix kinds.IntegerLiteralExprSyntax.Radix
.Parser.parseIncrementally(source:parseTransition:)
andParser.parseIncrementally(source:maximumNestingLevel:parseTransition:)
:Parser.parseIncrementally
return aIncrementalParseResult
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.IncrementalParseResult
type.SyntaxClassification
gained a new case:argumentLabel
SyntaxClassification
, cover the new case.SyntaxEnum
andSyntaxKind
gained new cases:throwsClause
ThrowsClauseSyntax
SyntaxEnum
andSyntaxKind
, cover the new case.MacroExpansionContext
now requires a propertylexicalContext
:MacroExpansionContext
will need to implement this property. Additionally, theHostToPluginMessage
casesexpandFreestandingMacro
andexpandAttachedMacro
now include an optionallexicalContext
. Finally, theSyntaxProtocol.expand(macros:in:indentationWidth:)
syntactic expansion operation has been deprecated in favor of a new versionexpand(macros:contextGenerator:indentationWidth:)
that takes a function produces a new macro expansion context for each expansion.lexicalContext
to anyMacroExpansionContext
-conforming types. If implementing the host-to-plugin message protocol, add support forlexicalContext
. For macro expansion operations going throughSyntaxProtocol.expand
, provide a context generator that creates a fresh context including the lexical context.TriviaPiece.isBackslash
inSwiftParserDiagnostics
removedTriviaPiece.isBackslash
was not intended to be public API.if case .backslash = triviaPiece
insteadAll symbols in
SwiftCompilerPluginMessageHandling
are now SPIConfiguration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.