Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency apple/swift-syntax to v600 #1162

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Sep 13, 2024

This PR contains the following updates:

Package Update Change
apple/swift-syntax major from: "510.0.3" -> from: "600.0.0"
apple/swift-syntax major from: "509.1.1" -> from: "600.0.0"
apple/swift-syntax major from: "508.0.1" -> from: "600.0.0"

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Release Notes

apple/swift-syntax (apple/swift-syntax)

v600.0.0

Compare Source

New APIs

  • FixIt now has a new computed property named edits

  • SourceEdit

  • assertMacroExpansion now have new parameters named applyFixIts and fixedSource

  • DeclSyntaxEnum, StmtSyntaxEnum, ExprSyntaxEnum, TypeSyntaxEnum, and PatternSyntaxEnum

  • WithOptionalCodeBlock

  • CodeBlockSyntax

  • ThrowsClause

    • Description: The throwsSpecifier for the effects nodes (AccessorEffectSpecifiers, FunctionEffectSpecifiers, TypeEffectSpecifiers, EffectSpecifiers) has been replaced with throwsClause, which captures both the throws specifier and the (optional) thrown error type, as introduced by SE-0413.
    • Pull Request: https://github.com/swiftlang/swift-syntax/pull/2379
  • String.isValidSwiftIdentifier(for:)

  • MacroDeclSyntax.expand

    • the expand(argumentList:definition:replacements:) method gains a new parameter 'genericReplacements:' that is defaulted to an empty array.
    • The method's signature is now expand(argumentList:definition:replacements:genericReplacements:)
    • Pull Request: https://github.com/swiftlang/swift-syntax/pull/2450
  • SyntaxProtocol.asMacroLexicalContext() and allMacroLexicalContexts(enclosingSyntax:)

  • TriviaPiece.isComment

  • New assertMacroExpansion API with option to specify macro specifications with macroSpecs argument

  • BasicFormat.inferIndentation(of:)

  • IncrementalEdit stores replacement text

    • Description: IncrementalEdit used to store the range that was replaced and the length of the replacement but not the replacement bytes by itself. IncrementalEdit now has a replacement property that contains the replacement bytes.
    • Pull Request: https://github.com/swiftlang/swift-syntax/pull/2527
  • Type specifiers

    • 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
    • Pull request: https://github.com/swiftlang/swift-syntax/pull/2433
  • DeclGroupSyntax.introducer

  • ExprSyntax.interpretedAsVersionTuple

    • Description: With the change to parse #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 access 3 to the 1.2 float literal. This property allows the reinterpretation of such an expression as a version tuple.
    • Pull request: https://github.com/swiftlang/swift-syntax/pull/2025
  • SyntaxProtocol.node(at:)

  • SyntaxIdentifier.IndexInTree

    • Description: Uniquely identifies a syntax node within a tree. This is similar to 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 are toOpaque and init(fromOpaque:), which allow serialization of the IndexInTree.
    • Pull request: https://github.com/swiftlang/swift-syntax/pull/2594
  • SyntaxIdentifier conformance to Comparable:

  • SyntaxIdentifier.indexInTree and SyntaxIdentifier.fromIndexInTree

    • Description: SyntaxIdentifier.indexInTree allows the retrieval of a SyntaxIdentifier that identifies the syntax node independent of the syntax tree. SyntaxIdentifier.fromIndexInTree allows the creation for a SyntaxIdentifier from a tree-agnostic SyntaxIdentifier.IndexInTree and the tree's root node.
    • Pull request: https://github.com/swiftlang/swift-syntax/pull/2594
  • SwiftSyntaxMacrosGenericTestSupport

    • Description: A version of the SwiftSyntaxMacrosTestSupport module that doesn't depend on Foundation or XCTest and can thus be used to write macro tests using swift-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)
    • Pull request: https://github.com/swiftlang/swift-syntax/pull/2647
  • TokenSyntax.identifier

Deprecations

  • Child Choice Node Casts

  • IncrementalParseTransition:

  • MacroExpansion{Error|Warning|FixIt}Message moved to the SwiftSyntaxMacros module

    • Description: Move the MacroExpansion{Error|Warning|FixIt}Message types from the SwiftSyntaxMacroExpansion module to SwiftSyntaxMacros. Deprecated typealiases in SwiftSyntaxMacroExpansion forward to SwiftSyntaxMacros.
    • Pull request: https://github.com/swiftlang/swift-syntax/pull/2338
    • 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.
  • EditorPlaceholderDeclSyntax and EditorPlaceholderExprSyntax:

    • Description: EditorPlaceholderDeclSyntax and EditorPlaceholderExprSyntax are now deprecated and placeholders are instead parsed as identifiers within a MissingDeclSyntax or DeclReferenceExprSyntax.
    • Pull request: https://github.com/swiftlang/swift-syntax/pull/2237
  • AttributedTypeSyntax.specifier has renamed to specifiers and changed to be a collection

  • CanImportExprSyntax and CanImportVersionInfoSyntax

    • Description: Instead of parsing canImport inside #if directives as a special expression node, parse it as a functionc call expression. This is in-line with how the swift(>=6.0) and compiler(>=6.0) directives are parsed.
    • Pull request: https://github.com/swiftlang/swift-syntax/pull/2025

API-Incompatible Changes

  • MacroDefinition used for expanding macros:

    • Description: The 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])
    • Pull request: https://github.com/swiftlang/swift-syntax/pull/2450
    • Migration steps: Code which exhaustively checked over the enum should be changed to 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:

    • Description: The unexpectedAfterThrowsSpecifier node of the various effect specifiers has been removed.
    • Pull request: https://github.com/swiftlang/swift-syntax/pull/2219
    • Migration steps: Check unexpectedBetweenThrowsSpecifierAndThrownError and unexpectedAfterThrownError instead.
  • SyntaxKind removed conformance to CaseIterable

    • Description: SyntaxKind no longer conforms to CaseIterable since there is no good use case to iterate over all syntax kinds.
    • Pull request: https://github.com/swiftlang/swift-syntax/pull/2292
    • 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.
  • IntegerLiteralExprSyntax.Radix removed conformance to CaseIterable

    • Description: IntegerLiteralExprSyntax.Radix no longer conforms to CaseIterable since there is no good use case to iterate over all radix kinds.
    • Pull request: https://github.com/swiftlang/swift-syntax/pull/2292
    • Migration steps: There should be no use case to iterate over all cases in IntegerLiteralExprSyntax.Radix.
  • Parser.parseIncrementally(source:parseTransition:) and Parser.parseIncrementally(source:maximumNestingLevel:parseTransition:):

    • 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.
    • Issue: https://github.com/swiftlang/swift-syntax/issues/2267
    • Pull request: https://github.com/swiftlang/swift-syntax/pull/2272
    • Migration steps: If necessary, change type annotations from the tuple to the IncrementalParseResult type.
  • SyntaxClassification gained a new case: argumentLabel

    • The new classification case covers the first names of parameters in function-like declarations and the label of arguments in function-like calls.
    • Pull request: https://github.com/swiftlang/swift-syntax/pull/2375
    • Migration steps: In exhaustive switches over SyntaxClassification, cover the new case.
  • SyntaxEnum and SyntaxKind gained new cases: throwsClause

  • MacroExpansionContext now requires a property lexicalContext:

    • 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.
    • Pull request: https://github.com/swiftlang/swift-syntax/pull/1554
    • 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.
  • TriviaPiece.isBackslash in SwiftParserDiagnostics removed

  • All symbols in SwiftCompilerPluginMessageHandling are now SPI


Configuration

📅 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 these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/apple-swift-syntax-600.x branch 6 times, most recently from 9cf3e19 to 2dc22bf Compare September 19, 2024 00:34
@renovate renovate bot force-pushed the renovate/apple-swift-syntax-600.x branch from 2dc22bf to 1238cf6 Compare September 20, 2024 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants