Update dependency swiftlang/swift-syntax to from: "600.0.1" - autoclosed #31
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: "600.0.0"->from: "600.0.1"Release Notes
swiftlang/swift-syntax (swiftlang/swift-syntax)
v600.0.1Compare Source
Compared to 600.0.0 this release fixes a compilation issue when building swift-syntax in C++ interop mode (https://github.com/swiftlang/swift-syntax/pull/2861).
It also contains the following changes from 600.0.0.
New APIs
FixIt now has a new computed property named
editseditsrepresent the non-overlapping textualeditsthat need to be performed when the Fix-It is applied.SourceEditSourceEdithas been moved from SwiftRefactor to SwiftSyntaxassertMacroExpansionnow have new parameters namedapplyFixItsandfixedSourceapplyFixItsandfixedSourceare used to assert so ensure that the source code after applying Fix-Its matches this string.DeclSyntaxEnum,StmtSyntaxEnum,ExprSyntaxEnum,TypeSyntaxEnum, andPatternSyntaxEnumWithOptionalCodeBlockFunctionDeclSyntaxandInitializerDeclSyntax.CodeBlockSyntaxCodeBlockSyntaxis nowSyntaxParseable, so it can be used with string interpolations.ThrowsClausethrowsSpecifierfor 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:)SwiftParseradds an extension onStringto check if it can be used as an identifier in a given context.MacroDeclSyntax.expandexpand(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.isCommentTriviaPiecenow has a computed propertyisCommentthat returnstrueif the trivia piece is a comment.New
assertMacroExpansionAPI with option to specify macro specifications withmacroSpecsargumentmacroSpecscan have additional specifications like conformances provided by member or extension macro that can be used for macro expansion.BasicFormat.inferIndentation(of:)IncrementalEditstores replacement textIncrementalEditused to store the range that was replaced and the length of the replacement but not the replacement bytes by itself.IncrementalEditnow has areplacementproperty that contains the replacement bytes.Type specifiers
AttributedTypeSyntaxcan 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,TypeSpecifierListSyntaxDeclGroupSyntax.introducerDeclGroupSyntaxtrait has an extraintroducerproperty, 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.3natively gets parsed as a member access3to the1.2float literal. This property allows the reinterpretation of such an expression as a version tuple.SyntaxProtocol.node(at:)SyntaxIdentifier, returns theSyntaxnode with that identifierSyntaxIdentifier.IndexInTreeSyntaxIdentifierbut 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 aretoOpaqueandinit(fromOpaque:), which allow serialization of theIndexInTree.SyntaxIdentifierconformance toComparable:SyntaxIdentifiercompares less than anotherSyntaxIdentifierif the node at that identifier occurs first during a depth-first traversal of the tree.SyntaxIdentifier.indexInTreeandSyntaxIdentifier.fromIndexInTreeSyntaxIdentifier.indexInTreeallows the retrieval of aSyntaxIdentifierthat identifies the syntax node independent of the syntax tree.SyntaxIdentifier.fromIndexInTreeallows the creation for aSyntaxIdentifierfrom a tree-agnosticSyntaxIdentifier.IndexInTreeand the tree's root node.SwiftSyntaxMacrosGenericTestSupportSwiftSyntaxMacrosTestSupportmodule that doesn't depend onFoundationorXCTestand 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.identifieridentifierproperty toTokenSyntaxwhich returns a canonicalized representation of an identifier that strips away backticks.Deprecations
Child Choice Node Casts
is,as, andcastmethods 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,asorcastmethods 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}Messagemoved to theSwiftSyntaxMacrosmoduleMacroExpansion{Error|Warning|FixIt}Messagetypes from theSwiftSyntaxMacroExpansionmodule toSwiftSyntaxMacros. Deprecated typealiases inSwiftSyntaxMacroExpansionforward toSwiftSyntaxMacros.SwiftSyntaxMacroExpansion, which is intended as an implementation detail of the plugin server and should not need to be imported by macros.EditorPlaceholderDeclSyntaxandEditorPlaceholderExprSyntax:EditorPlaceholderDeclSyntaxandEditorPlaceholderExprSyntaxare now deprecated and placeholders are instead parsed as identifiers within aMissingDeclSyntaxorDeclReferenceExprSyntax.AttributedTypeSyntax.specifierhas renamed tospecifiersand changed to be a collectionCanImportExprSyntaxandCanImportVersionInfoSyntaxcanImportinside#ifdirectives 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
MacroDefinitionused for expanding macros:MacroDefinition/expansionenum 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.extensiongained a compatibility shim, retaining the previous syntax source compatible (return .expansion(node, replacements: [])).Effect specifiers:
unexpectedAfterThrowsSpecifiernode of the various effect specifiers has been removed.unexpectedBetweenThrowsSpecifierAndThrownErrorandunexpectedAfterThrownErrorinstead.SyntaxKindremoved conformance toCaseIterableSyntaxKindno longer conforms toCaseIterablesince there is no good use case to iterate over all syntax kinds.SyntaxKind.IntegerLiteralExprSyntax.Radixremoved conformance toCaseIterableIntegerLiteralExprSyntax.Radixno longer conforms toCaseIterablesince there is no good use case to iterate over all radix kinds.IntegerLiteralExprSyntax.Radix.Parser.parseIncrementally(source:parseTransition:)andParser.parseIncrementally(source:maximumNestingLevel:parseTransition:):Parser.parseIncrementallyreturn aIncrementalParseResultinstead 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.IncrementalParseResulttype.SyntaxClassificationgained a new case:argumentLabelSyntaxClassification, cover the new case.SyntaxEnumandSyntaxKindgained new cases:throwsClauseThrowsClauseSyntaxSyntaxEnumandSyntaxKind, cover the new case.MacroExpansionContextnow requires a propertylexicalContext:MacroExpansionContextwill need to implement this property. Additionally, theHostToPluginMessagecasesexpandFreestandingMacroandexpandAttachedMacronow 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.lexicalContextto 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.isBackslashinSwiftParserDiagnosticsremovedTriviaPiece.isBackslashwas not intended to be public API.if case .backslash = triviaPieceinsteadAll symbols in
SwiftCompilerPluginMessageHandlingare 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 becomes conflicted, 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.