Skip to content

Releases: swiftlang/swift-syntax

602.0.0-prerelease-2025-04-16

16 Apr 17:48
340f840
Compare
Choose a tag to compare
Pre-release
Merge pull request #3049 from ahoppen/6.2/default-release-version

Change default release version in GitHub action to `602.0.0`

602.0.0-prerelease-2025-04-10

10 Apr 15:38
340f840
Compare
Choose a tag to compare
Pre-release
Merge pull request #3049 from ahoppen/6.2/default-release-version

Change default release version in GitHub action to `602.0.0`

601.0.1

02 Apr 20:39
Compare
Choose a tag to compare

Fixes a missing dependency from SwiftSyntax to SwiftSyntax601 which prevented its use in #if canImport.

601.0.0

28 Mar 21:23
1103c45
Compare
Choose a tag to compare

New APIs

  • SameTypeRequirementSyntax has a new RightType nested type.

    • Description: The Swift parser can now parse values as types in certain situations, so the new type reflects the possibility of the argument being either an ExprSyntax or a TypeSyntax.
    • Pull Request: #2859
  • SameTypeRequirementSyntax has a new LeftType nested type.

    • Description: The Swift parser can now parse values as types in certain situations, so the new type reflects the possibility of the argument being either an ExprSyntax or a TypeSyntax.
    • Pull Request: #2859
  • GenericArgumentSynax has a new Argument nested type.

    • Description: The Swift parser can now parse values as types in certain situations, so the new type reflects the possibility of the argument being either an ExprSyntax or a TypeSyntax.
    • Pull Request: #2859
  • GenericParameterSyntax now has a new specifier property.

    • Description: With the introduction of value generics, generic parameters can now be optionally preceded by either a let or an each. The specifier property captures the token representing which one was parsed.
    • Pull Request: #2785
  • IntegerLiteralExprSyntax and FloatLiteralExprSyntax now have a computed representedLiteralValue property.

    • Description: Allows retrieving the represented literal value when valid.
    • Issue: #405
    • Pull Request: #2605
  • SyntaxProtocol now has a method ancestorOrSelf.

    • Description: Returns the node or the first ancestor that satisfies condition.
    • Pull Request: #2696
  • Error protocol now has an asDiagnostics(at:) method.

    • Description: This method translates an error into one or more diagnostics, recognizing DiagnosticsError and DiagnosticMessage instances or providing its own Diagnostic as needed.
    • Pull Request: #1816
  • Added a new library SwiftIfConfig.

    • Description: This new library provides facilities for evaluating #if conditions and determining which regions of a syntax tree are active according to a given build configuration.
    • Pull Request: #1816
  • SwiftBasicFormat adds a method indented(by:) to all syntax node types.

    • Description: This method indents a node’s contents using a provided piece of Trivia, optionally including the first line.
    • Pull Request: #2843
  • Parser.ExperimentalFeatures has a new init?(name: String) initializer.

    • Description: This initializer returns the Parser.ExperimentalFeatures value that matches the experimental parser feature with the given name. The name must be spelled the same way as it is when passed to the compiler using the -enable-experimental-feature flag.
    • Pull Request: #2895

API Behavior Changes

  • SyntaxProtocol.trimmed detaches the node
    • Description: Getting a trimmed version of a node detaches it from its parent. Having the trimmed node be attached to a parent was not intuitive because eg. printing the parent node would have the trimmed trivia missing, most likely forming invalid Swift code.
    • Pull Request: #2689

Deprecations

  • GenericParameterSyntax deprecated eachKeyword in favor of specifier

    • Description: specifier is now used to grab either the each keyword for a generic parameter or the let keyword.
    • Pull request: #2785
  • IncrementalEdit deprecated in favor of SourceEdit

    • Description: IncrementalEdit is being dropped for SourceEdit. SourceEdit has deprecated compatibility layers to make it API-compatible with IncrementalEdit
    • Issue: #2532
    • Pull request: #2604
  • ClosureCaptureSyntax.init(leadingTrivia:specifier:name:equal:expression:trailingComma:trailingTrivia:) deprecated in favor of a new ClosureCaptureSyntax.init(leadingTrivia:_:specifier:_:name:_:initializer:_:trailingComma:_:trailingTrivia:) initializer.

    • Description: ClosureCaptureSyntax now has an initializer property instead of equal and expression. Additionally, the name property is no longer optional.
    • Pull request: #2763
  • Indenter in SwiftSyntaxBuilder has been deprecated in favor of the new indented(by:) in SwiftBasicFormat.

    • Description: Indenting is really more of a formatting operation than a syntax-building operation. Additionally, the indented(by:) method is more intuitive to use than a SyntaxRewriter. Aside from BasicFormat, there are no other public SyntaxRewriter classes in the package.
    • Pull Request: #2843

API-Incompatible Changes

  • SameTypeRequirementSyntax.rightType has changed types from TypeSyntax to SameTypeRequirementSyntax.RightType

    • Description: The Swift parser can now parse values as types in certain situations, so the new type reflects the possibility of the argument being either an ExprSyntax or a TypeSyntax.
    • Pull Request: #2859
  • SameTypeRequirementSyntax.leftType has changed types from TypeSyntax to SameTypeRequirementSyntax.LeftType

    • Description: The Swift parser can now parse values as types in certain situations, so the new type reflects the possibility of the argument being either an ExprSyntax or a TypeSyntax.
    • Pull Request: #2859
  • GenericArgumentSyntax.argument has changed types from TypeSyntax to GenericArgumentSyntax.Argument

    • Description: The Swift parser can now parse values as types in certain situations, so the new type reflects the possibility of the argument being either an ExprSyntax or a TypeSyntax.
    • Pull Request: #2859
  • Moved Radix and IntegerLiteralExprSyntax.radix from SwiftRefactor to SwiftSyntax.

    • Description: Allows retrieving the radix value from the literal.text.
    • Issue: #405
    • Pull Request: #2605
  • FixIt.Change gained a new case replaceChild(data:).

    • Description: The new case covers the replacement of a child node with another node.
    • Issue: #2205
    • Pull Request: #2758
    • Migration steps: In exhaustive switches over FixIt.Change, cover the new case.
  • ClosureCaptureSyntax.name is no longer optional.

    • Description: Due to the new ClosureCaptureSyntax node structure, name property is non-optional.
    • Pull request: #2763

600.0.1

25 Sep 17:17
0687f71
Compare
Choose a tag to compare

Compared to 600.0.0 this release fixes a compilation issue when building swift-syntax in C++ interop mode (#2861).

It also contains the following changes from 600.0.0.

New APIs

  • FixIt now has a new computed property named edits

    • Description: the edits represent the non-overlapping textual edits that need to be performed when the Fix-It is applied.
    • Issue: swiftlang/sourcekit-lsp#909
    • Pull Request: #2314
  • SourceEdit

  • assertMacroExpansion now have new parameters named applyFixIts and fixedSource

    • Description: applyFixIts and fixedSource are used to assert so ensure that the source code after applying Fix-Its matches this string.
    • Issue: #2015
    • Pull Request: #2021
  • DeclSyntaxEnum, StmtSyntaxEnum, ExprSyntaxEnum, TypeSyntaxEnum, and PatternSyntaxEnum

    • Description: Enum to exhaustively switch over all different syntax nodes of each base type.
    • Pull Request: #2351
  • WithOptionalCodeBlock

    • Description: A trait for syntax nodes that have an optional code block, such as FunctionDeclSyntax and InitializerDeclSyntax.
    • Pull Request: #2359
  • CodeBlockSyntax

    • Description: CodeBlockSyntax is now SyntaxParseable, so it can be used with string interpolations.
    • Pull Request: #2361
  • 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: #2379
  • String.isValidSwiftIdentifier(for:)

    • Description: SwiftParser adds an extension on String to check if it can be used as an identifier in a given context.
    • Pull Request: #2434
  • 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: #2450
  • SyntaxProtocol.asMacroLexicalContext() and allMacroLexicalContexts(enclosingSyntax:)

    • Description: Produce the lexical context for a given syntax node (if it has one), or the entire stack of lexical contexts enclosing a syntax node, for use in macro expansion.
    • Pull request: #1554
  • TriviaPiece.isComment

    • Description: TriviaPiece now has a computed property isComment that returns true if the trivia piece is a comment.
    • Pull Request: #2469
  • New assertMacroExpansion API with option to specify macro specifications with macroSpecs argument

    • Description: macroSpecs can have additional specifications like conformances provided by member or extension macro that can be used for macro expansion.
    • Issue: #2031
    • Pull Request: #2327
  • BasicFormat.inferIndentation(of:)

    • Description: Uses heuristics to infer the indentation width used in a syntax tree.
    • Pull Request: #2514
  • 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: #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: #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: #2025
  • SyntaxProtocol.node(at:)

    • Description: Given a SyntaxIdentifier, returns the Syntax node with that identifier
    • Pull request: #2594
  • 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: #2594
  • SyntaxIdentifier conformance to Comparable:

    • Description: A SyntaxIdentifier compares less than another SyntaxIdentifier if the node at that identifier occurs first during a depth-first traversal of the tree.
    • Pull request: #2594
  • 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: #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: #2647
  • TokenSyntax.identifier

    • Description: Adds an identifier property to TokenSyntax which returns a canonicalized representation of an identifier that strips away backticks.
    • Pull request: #2576

Deprecations

  • Child Choice Node Casts

    • 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.
    • Issue: #2092
    • Pull Request: #2184
    • Migration steps: Remove the is, as or cast methods because they will always fail.
  • IncrementalParseTransition:

    • Description: The initializer IncrementalParseTransition.init(previousTree:edits:lookaheadRanges:reusedNodeCallback:) is marked as deprecated. Use IncrementalParseTransition.init(previousIncrementalParseResult:edits:reusedNodeCallback:) instead.
    • Issue: #2267
    • Pull request: #2272
    • Migration steps: Call IncrementalParseTransition.init(previousIncrementalParseResult:edits:reusedNodeCallback:) instead.
  • 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: #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 inst...
Read more

600.0.0

13 Sep 18:37
cb53fa1
Compare
Choose a tag to compare

New APIs

  • FixIt now has a new computed property named edits

    • Description: the edits represent the non-overlapping textual edits that need to be performed when the Fix-It is applied.
    • Issue: swiftlang/sourcekit-lsp#909
    • Pull Request: #2314
  • SourceEdit

  • assertMacroExpansion now have new parameters named applyFixIts and fixedSource

    • Description: applyFixIts and fixedSource are used to assert so ensure that the source code after applying Fix-Its matches this string.
    • Issue: #2015
    • Pull Request: #2021
  • DeclSyntaxEnum, StmtSyntaxEnum, ExprSyntaxEnum, TypeSyntaxEnum, and PatternSyntaxEnum

    • Description: Enum to exhaustively switch over all different syntax nodes of each base type.
    • Pull Request: #2351
  • WithOptionalCodeBlock

    • Description: A trait for syntax nodes that have an optional code block, such as FunctionDeclSyntax and InitializerDeclSyntax.
    • Pull Request: #2359
  • CodeBlockSyntax

    • Description: CodeBlockSyntax is now SyntaxParseable, so it can be used with string interpolations.
    • Pull Request: #2361
  • 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: #2379
  • String.isValidSwiftIdentifier(for:)

    • Description: SwiftParser adds an extension on String to check if it can be used as an identifier in a given context.
    • Pull Request: #2434
  • 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: #2450
  • SyntaxProtocol.asMacroLexicalContext() and allMacroLexicalContexts(enclosingSyntax:)

    • Description: Produce the lexical context for a given syntax node (if it has one), or the entire stack of lexical contexts enclosing a syntax node, for use in macro expansion.
    • Pull request: #1554
  • TriviaPiece.isComment

    • Description: TriviaPiece now has a computed property isComment that returns true if the trivia piece is a comment.
    • Pull Request: #2469
  • New assertMacroExpansion API with option to specify macro specifications with macroSpecs argument

    • Description: macroSpecs can have additional specifications like conformances provided by member or extension macro that can be used for macro expansion.
    • Issue: #2031
    • Pull Request: #2327
  • BasicFormat.inferIndentation(of:)

    • Description: Uses heuristics to infer the indentation width used in a syntax tree.
    • Pull Request: #2514
  • 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: #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: #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: #2025
  • SyntaxProtocol.node(at:)

    • Description: Given a SyntaxIdentifier, returns the Syntax node with that identifier
    • Pull request: #2594
  • 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: #2594
  • SyntaxIdentifier conformance to Comparable:

    • Description: A SyntaxIdentifier compares less than another SyntaxIdentifier if the node at that identifier occurs first during a depth-first traversal of the tree.
    • Pull request: #2594
  • 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: #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: #2647
  • TokenSyntax.identifier

    • Description: Adds an identifier property to TokenSyntax which returns a canonicalized representation of an identifier that strips away backticks.
    • Pull request: #2576

Deprecations

  • Child Choice Node Casts

    • 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.
    • Issue: #2092
    • Pull Request: #2184
    • Migration steps: Remove the is, as or cast methods because they will always fail.
  • IncrementalParseTransition:

    • Description: The initializer IncrementalParseTransition.init(previousTree:edits:lookaheadRanges:reusedNodeCallback:) is marked as deprecated. Use IncrementalParseTransition.init(previousIncrementalParseResult:edits:reusedNodeCallback:) instead.
    • Issue: #2267
    • Pull request: #2272
    • Migration steps: Call IncrementalParseTransition.init(previousIncrementalParseResult:edits:reusedNodeCallback:) instead.
  • 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: #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: #2237
  • AttributedTypeSyntax.specifier has renamed to specifiers and changed to be a collection

    • Description: Types can h...
Read more

600.0.0-prerelease-2024-09-04

05 Sep 23:39
515f79b
Compare
Choose a tag to compare
Pre-release
Merge pull request #2801 from SimplyDanny/increase-compiler-version

[6.0] Increase tools version

600.0.0-prerelease-2024-08-14

15 Aug 01:16
515f79b
Compare
Choose a tag to compare
Pre-release
Merge pull request #2801 from SimplyDanny/increase-compiler-version

[6.0] Increase tools version

510.0.3

01 Aug 23:45
2bc8652
Compare
Choose a tag to compare

Compared to 510.0.2 improves swift-syntax’s ability to build using Bazel.

It also contains the following changes from 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
  • SyntaxCollection.index(at:)

    • Description: Returns the index of the n-th element in a SyntaxCollection. This computation is in O(n) and SyntaxCollection is not subscriptable by an integer.
    • Pull Request: #2014
  • Convenience initializer ClosureCaptureSyntax.init()

    • Description: Provides a convenience initializer for ClosureCaptureSyntax that takes a concrete name argument and automatically adds equal = TokenSyntax.equalToken() to it.
    • Issue: #1984
    • Pull Request: #2127
  • Convenience initializer EnumCaseParameterSyntax.init()

    • Description: Provides a convenience initializer for EnumCaseParameterSyntax that takes a concrete firstName value and adds colon = TokenSyntax.colonToken() automatically to it.
    • Issue: #1984
    • Pull Request: #2112
  • DiagnosticSeverity and PluginMessage.Diagnostic.Severity now have new case named remark

    • 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

    • Description: Syntax nodes that do not act as base nodes for other syntax types have the casting methods marked as deprecated. This prevents unsafe type-casting by issuing deprecation warnings for methods that will always result in failed casts.
    • Issue: #2092
    • Pull Request: #2108
  • Same-Type Casts

    • Description: is, as, and cast overloads on SyntaxProtocol with same-type conversions are marked as deprecated. The deprecated methods emit a warning indicating the cast will always succeed.
    • Issue: #2092
    • Pull Request: #2108
  • Base Node Casts

    • Description: is, as, and cast methods on base node protocols with base-type conversions are marked as deprecated. The deprecated methods emit a warning that informs the developer that the cast will always succeed and should be done using the base node's initializer.
    • Issue: #2092
    • Pull Request: #2108
  • WildcardPatternSyntax.typeAnnotation

    • Description: typeAnnotation on WildcardPatternSyntax was a mistake. Use typeAnnotation properties on the outer constructs instead. E.g. PatternBindingListSyntax.typeAnnotation
    • Pull Request: #2393

API-Incompatible Changes

  • NoteMessage.fixItID renamed to noteID

    • Description: This was an error that it was named fixItID and should have been named noteID instead. Accesses to fixItID are deprecated and forward to noteID. Any types that conform NoteMessage it will need to be updated to provide a noteID instead of a fixItID.
    • Issue: #2261
    • Pull Request: #2264
  • DiagnosticSpec.highlight replaced by highlights

    • Description: The use of a single string highlight prevented users from asserting that a macro highlighted exactly the expected set of syntax nodes. Use of DiagnosticSpec.init(...highlight:...) is deprecated and forwards to DiagnosticSpec.init(...highlights:...). Migrating from highlight to highlights is straightforward; any uses of DiagnosticSpec.init which do not specify a highlight do not need to change, otherwise:
      • If the diagnostic highlights a single node, the highlight string 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 highlight string should be replaced with an array containing an element for each highlighted node, e.g., highlight: "struct {}" -> highlights: ["struct", "{}"].
    • Pull Request: #2213

600.0.0-prerelease-2024-07-24

24 Jul 22:11
82a453c
Compare
Choose a tag to compare
Pre-release
Merge pull request #2751 from ahoppen/6.0/fix-build-warnings

[6.0] Fix build warnings