diff --git a/.github/ISSUE_TEMPLATE/BASICFORMAT_BUG.yml b/.github/ISSUE_TEMPLATE/BASICFORMAT_BUG.yml index a2c8f864f8e..79e609f887f 100644 --- a/.github/ISSUE_TEMPLATE/BASICFORMAT_BUG.yml +++ b/.github/ISSUE_TEMPLATE/BASICFORMAT_BUG.yml @@ -2,38 +2,38 @@ name: BasicFormat Bug description: A bug in the BasicFormat module labels: [bug, BasicFormat] body: - - type: markdown - attributes: - value: Thanks for taking the time to fill out this bug report! We would really appreciate if you could take the time to reduce the issue as described in [Filing BasicFormat Bug Reports](https://swiftpackageindex.com/swiftlang/swift-syntax/main/documentation/swiftbasicformat/filingbugreports). - - type: textarea - id: source - attributes: - label: Source Code - description: The source code that, when formatted, produces incorrectly formatted code. - value: | - ```swift - ``` - - type: textarea - id: source - attributes: - label: Actual Formatted Code - description: The way that `BasicFormat` formats the above code - value: | - ```swift - ``` + - type: markdown + attributes: + value: Thanks for taking the time to fill out this bug report! We would really appreciate if you could take the time to reduce the issue as described in [Filing BasicFormat Bug Reports](https://swiftpackageindex.com/swiftlang/swift-syntax/main/documentation/swiftbasicformat/filingbugreports). - type: textarea - id: source - attributes: - label: Expected Formatted Code - description: The way that you think `BasicFormat` should format the code - value: | - ```swift - ``` - - type: textarea - id: description - attributes: - label: Description - description: | - Any additional information you can provide for this issue, like - - Has this issue started occurring recently? - - Is the issue only happening under certain circumstances? + id: source + attributes: + label: Source Code + description: The source code that, when formatted, produces incorrectly formatted code. + value: | + ```swift + ``` + - type: textarea + id: source + attributes: + label: Actual Formatted Code + description: The way that `BasicFormat` formats the above code + value: | + ```swift + ``` + - type: textarea + id: source + attributes: + label: Expected Formatted Code + description: The way that you think `BasicFormat` should format the code + value: | + ```swift + ``` + - type: textarea + id: description + attributes: + label: Description + description: | + Any additional information you can provide for this issue, like + - Has this issue started occurring recently? + - Is the issue only happening under certain circumstances? diff --git a/.github/ISSUE_TEMPLATE/BUG_REPORT.yml b/.github/ISSUE_TEMPLATE/BUG_REPORT.yml index 8ed310e64fe..fc741ffe25e 100644 --- a/.github/ISSUE_TEMPLATE/BUG_REPORT.yml +++ b/.github/ISSUE_TEMPLATE/BUG_REPORT.yml @@ -2,17 +2,17 @@ name: Bug Report description: Something isn't working as expected labels: [bug] body: - - type: textarea - id: description - attributes: - label: Description - description: | - A short description of the incorrect behavior. - If you think this issue has been recently introduced and did not occur in an - earlier version, please note that. If possible, include the last version that - the behavior was correct in addition to your current version. - - type: textarea - id: steps-to-reproduce - attributes: - label: Steps to Reproduce - description: Replace this paragraph with an explanation of how to reproduce the incorrect behavior. + - type: textarea + id: description + attributes: + label: Description + description: | + A short description of the incorrect behavior. + If you think this issue has been recently introduced and did not occur in an + earlier version, please note that. If possible, include the last version that + the behavior was correct in addition to your current version. + - type: textarea + id: steps-to-reproduce + attributes: + label: Steps to Reproduce + description: Replace this paragraph with an explanation of how to reproduce the incorrect behavior. diff --git a/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.yml b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.yml index 8ed16f4ea74..30f157e5593 100644 --- a/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.yml +++ b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.yml @@ -2,12 +2,12 @@ name: Feature Request description: A suggestion for a new feature labels: [enhancement] body: - - type: textarea - id: description - attributes: - label: Description - description: | - A description of your proposed feature. - Examples that show what's missing, or what new capabilities will be possible, are very helpful! - If this feature unlocks new use-cases please describe them. - Provide links to existing issues or external references/discussions, if appropriate. + - type: textarea + id: description + attributes: + label: Description + description: | + A description of your proposed feature. + Examples that show what's missing, or what new capabilities will be possible, are very helpful! + If this feature unlocks new use-cases please describe them. + Provide links to existing issues or external references/discussions, if appropriate. diff --git a/.github/ISSUE_TEMPLATE/PARSER_BUG.yml b/.github/ISSUE_TEMPLATE/PARSER_BUG.yml index 7cf33b92d27..9f66a1d9975 100644 --- a/.github/ISSUE_TEMPLATE/PARSER_BUG.yml +++ b/.github/ISSUE_TEMPLATE/PARSER_BUG.yml @@ -2,36 +2,36 @@ name: SwiftParser Bug description: A bug in the new Swift parser labels: [bug, SwiftParser] body: - - type: markdown - attributes: - value: Thanks for taking the time to fill out this bug report! We would really appreciate if you could take the time to reduce the issue as described in [Filing Parser Bug Reports](https://swiftpackageindex.com/swiftlang/swift-syntax/main/documentation/swiftparser/filingbugreports). - - type: dropdown - id: issue-type - attributes: - label: Issue Kind - description: What kind of issue is this? See [Filing Parser Bug Reports](https://swiftpackageindex.com/swiftlang/swift-syntax/main/documentation/swiftparser/filingbugreports) for more details. - options: - - Round-Trip Failure - - Parser Crash - - Parse of Valid Source Failed - - Parse of Valid Source Produced Invalid Syntax Tree - - Bad Diagnostic Produced - - Other - - I Don’t Know - - type: textarea - id: source - attributes: - label: Source Code - description: The source code that, when fed into the parser, produces the bug. - value: | - ```swift - ``` - - type: textarea - id: description - attributes: - label: Description - description: | - Any additional information you can provide for this issue, like - - What did you expect to happen? - - Has this issue started occurring recently? - - If it’s a crash, the stack trace. + - type: markdown + attributes: + value: Thanks for taking the time to fill out this bug report! We would really appreciate if you could take the time to reduce the issue as described in [Filing Parser Bug Reports](https://swiftpackageindex.com/swiftlang/swift-syntax/main/documentation/swiftparser/filingbugreports). + - type: dropdown + id: issue-type + attributes: + label: Issue Kind + description: What kind of issue is this? See [Filing Parser Bug Reports](https://swiftpackageindex.com/swiftlang/swift-syntax/main/documentation/swiftparser/filingbugreports) for more details. + options: + - Round-Trip Failure + - Parser Crash + - Parse of Valid Source Failed + - Parse of Valid Source Produced Invalid Syntax Tree + - Bad Diagnostic Produced + - Other + - I Don’t Know + - type: textarea + id: source + attributes: + label: Source Code + description: The source code that, when fed into the parser, produces the bug. + value: | + ```swift + ``` + - type: textarea + id: description + attributes: + label: Description + description: | + Any additional information you can provide for this issue, like + - What did you expect to happen? + - Has this issue started occurring recently? + - If it’s a crash, the stack trace. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index abe51dbfea7..5bb235ac349 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,15 +1,15 @@ # This source file is part of the Swift.org open source project - # - # Copyright (c) 2022 Apple Inc. and the Swift project authors - # Licensed under Apache License v2.0 with Runtime Library Exception - # - # See https://swift.org/LICENSE.txt for license information - # See https://swift.org/CONTRIBUTORS.txt for Swift project authors +# +# Copyright (c) 2022 Apple Inc. and the Swift project authors +# Licensed under Apache License v2.0 with Runtime Library Exception +# +# See https://swift.org/LICENSE.txt for license information +# See https://swift.org/CONTRIBUTORS.txt for Swift project authors - contact_links: - - name: Discussion Forum - url: https://forums.swift.org/tags/c/development/tooling/39/swift-syntax - about: Ask and answer questions about SwiftSyntax - - name: SwiftSyntax Documentation - url: https://swiftpackageindex.com/swiftlang/swift-syntax/documentation/swiftsyntax - about: Learn about how to use the SwiftSyntax in your projects +contact_links: + - name: Discussion Forum + url: https://forums.swift.org/tags/c/development/tooling/39/swift-syntax + about: Ask and answer questions about SwiftSyntax + - name: SwiftSyntax Documentation + url: https://swiftpackageindex.com/swiftlang/swift-syntax/documentation/swiftsyntax + about: Learn about how to use the SwiftSyntax in your projects diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 8e482fff130..89c27f8f6a5 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -15,13 +15,8 @@ jobs: name: Soundness uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main with: - # https://github.com/swiftlang/swift-syntax/issues/2986 - api_breakage_check_enabled: false + api_breakage_check_allowlist_path: "Release Notes/api-breakages.txt" # https://github.com/swiftlang/swift-syntax/issues/2987 docs_check_enabled: false # https://github.com/swiftlang/swift-syntax/issues/2988 format_check_enabled: false - # https://github.com/swiftlang/swift-syntax/issues/2990 - unacceptable_language_check_enabled: false - # https://github.com/swiftlang/swift-syntax/issues/2991 - yamllint_check_enabled: false diff --git a/.spi.yml b/.spi.yml index 5ed74fe1c95..1118de8d5a6 100644 --- a/.spi.yml +++ b/.spi.yml @@ -1,4 +1,4 @@ -# This is manifest file for the Swift Package Index for it to +# This is manifest file for the Swift Package Index for it to # auto-generate and host DocC documentation. # For reference see https://swiftpackageindex.com/swiftpackageindex/spimanifest/documentation/spimanifest/commonusecases#Host-DocC-documentation-in-the-Swift-Package-Index. @@ -6,21 +6,21 @@ version: 1 builder: configs: - documentation_targets: - # First item in the list is the "landing" (default) target - - SwiftSyntax - - SwiftBasicFormat - - SwiftCompilerPlugin - - SwiftDiagnostics - - SwiftIDEUtils - - SwiftIfConfig - - SwiftLexicalLookup - - SwiftOperators - - SwiftParser - - SwiftParserDiagnostics - - SwiftRefactor - - SwiftSyntaxBuilder - - SwiftSyntaxMacros - - SwiftSyntaxMacroExpansion - - SwiftSyntaxMacrosGenericTestSupport - - SwiftSyntaxMacrosTestSupport + # First item in the list is the "landing" (default) target + - SwiftSyntax + - SwiftBasicFormat + - SwiftCompilerPlugin + - SwiftDiagnostics + - SwiftIDEUtils + - SwiftIfConfig + - SwiftLexicalLookup + - SwiftOperators + - SwiftParser + - SwiftParserDiagnostics + - SwiftRefactor + - SwiftSyntaxBuilder + - SwiftSyntaxMacros + - SwiftSyntaxMacroExpansion + - SwiftSyntaxMacrosGenericTestSupport + - SwiftSyntaxMacrosTestSupport custom_documentation_parameters: [--experimental-skip-synthesized-symbols] diff --git a/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxBaseNodesFile.swift b/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxBaseNodesFile.swift index e308b4364e6..b78e59e9337 100644 --- a/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxBaseNodesFile.swift +++ b/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxBaseNodesFile.swift @@ -42,7 +42,7 @@ let syntaxBaseNodesFile = SourceFileSyntax(leadingTrivia: copyrightHeader) { /// These methods enable casting between syntax node types within the same /// base node protocol hierarchy (e.g., ``DeclSyntaxProtocol``). /// - /// While ``SyntaxProtocol`` offers general casting methods (``SyntaxProtocol.as(_:)``, + /// While ``SyntaxProtocol`` offers general casting methods (``SyntaxProtocol.as(_:)``, /// ``SyntaxProtocol.is(_:)``, and ``SyntaxProtocol.cast(_:)``), these often aren't /// appropriate for use on types conforming to a specific base node protocol /// like ``\#(node.kind.protocolType)``. That's because at this level, @@ -51,7 +51,7 @@ let syntaxBaseNodesFile = SourceFileSyntax(leadingTrivia: copyrightHeader) { /// /// To guide developers toward correct usage, this extension provides overloads /// of these casting methods that are restricted to the same base node type. - /// Furthermore, it marks the inherited casting methods from ``SyntaxProtocol`` as + /// Furthermore, it marks the inherited casting methods from ``SyntaxProtocol`` as /// deprecated, indicating that they will always fail when used in this context. extension \#(node.kind.protocolType) { /// Checks if the current syntax node can be cast to a given specialized syntax type. @@ -184,9 +184,8 @@ let syntaxBaseNodesFile = SourceFileSyntax(leadingTrivia: copyrightHeader) { """ /// Create a \(raw: node.kind.doccLink) node from a specialized syntax node. public init(_ syntax: __shared some \(node.kind.protocolType)) { - // We know this cast is going to succeed. Go through init(_: SyntaxData) - // to do a sanity check and verify the kind matches in debug builds and get - // maximum performance in release builds. + // We know this cast is going to succeed. Go through `init(_: SyntaxData)` just to double-check and + // verify the kind matches in debug builds and get maximum performance in release builds. self = Syntax(syntax).cast(Self.self) } """ @@ -205,9 +204,8 @@ let syntaxBaseNodesFile = SourceFileSyntax(leadingTrivia: copyrightHeader) { DeclSyntax( """ public init(fromProtocol syntax: __shared \(node.kind.protocolType)) { - // We know this cast is going to succeed. Go through init(_: SyntaxData) - // to do a sanity check and verify the kind matches in debug builds and get - // maximum performance in release builds. + // We know this cast is going to succeed. Go through `init(_: SyntaxData)` just to double-check and + // verify the kind matches in debug builds and get maximum performance in release builds. self = Syntax(syntax).cast(Self.self) } """ diff --git a/Contributor Documentation/API Breakage Checks.md b/Contributor Documentation/API Breakage Checks.md new file mode 100644 index 00000000000..968b9353ad3 --- /dev/null +++ b/Contributor Documentation/API Breakage Checks.md @@ -0,0 +1,5 @@ +# API Breakage Checks + +We have a CI jobs that checks for API breakages. Since swift-syntax releases increase the major version number, it is possible to make API-breaking changes – but we should avoid them whenever possible to avoid churn on clients when they update to a new swift-syntax version. + +If your change contains an API breaking change, add the change to `api-breakages.txt`. All API breaking changes should be accompanied by an [RFC](RFC%20Process.md). diff --git a/Contributor Documentation/README.md b/Contributor Documentation/README.md index 37c106886ee..72cff47f7e8 100644 --- a/Contributor Documentation/README.md +++ b/Contributor Documentation/README.md @@ -2,6 +2,7 @@ The following documentation documents are primarily intended for developers of swift-syntax. +- [API Breakage Checks](API%20Breakage%20Checks.md) - [Changing Swift Syntax](Changing%20Swift%20Syntax.md) - [Filing Parser Bug Reports](Filing%20Parser%20Bug%20Reports.md) - [Fixing Bugs](Fixing%20Bugs.md) diff --git a/Sources/SwiftParser/Expressions.swift b/Sources/SwiftParser/Expressions.swift index 43ffba08257..c7cd30757b8 100644 --- a/Sources/SwiftParser/Expressions.swift +++ b/Sources/SwiftParser/Expressions.swift @@ -583,7 +583,7 @@ extension Parser { ) -> RawExprSyntax { // Try parse a single value statement as an expression (e.g do/if/switch). // Note we do this here in parseUnaryExpression as we don't allow postfix - // syntax to hang off such expressions to avoid ambiguities such as postfix + // syntax to be attached to such expressions to avoid ambiguities such as postfix // '.member', which can currently be parsed as a static dot member for a // result builder. switch self.at(anyIn: SingleValueStatementExpression.self) { diff --git a/Sources/SwiftSyntax/generated/SyntaxBaseNodes.swift b/Sources/SwiftSyntax/generated/SyntaxBaseNodes.swift index c48884aa317..255f7fc5214 100644 --- a/Sources/SwiftSyntax/generated/SyntaxBaseNodes.swift +++ b/Sources/SwiftSyntax/generated/SyntaxBaseNodes.swift @@ -26,7 +26,7 @@ public protocol DeclSyntaxProtocol: SyntaxProtocol {} /// These methods enable casting between syntax node types within the same /// base node protocol hierarchy (e.g., ``DeclSyntaxProtocol``). /// -/// While ``SyntaxProtocol`` offers general casting methods (``SyntaxProtocol.as(_:)``, +/// While ``SyntaxProtocol`` offers general casting methods (``SyntaxProtocol.as(_:)``, /// ``SyntaxProtocol.is(_:)``, and ``SyntaxProtocol.cast(_:)``), these often aren't /// appropriate for use on types conforming to a specific base node protocol /// like ``DeclSyntaxProtocol``. That's because at this level, @@ -35,7 +35,7 @@ public protocol DeclSyntaxProtocol: SyntaxProtocol {} /// /// To guide developers toward correct usage, this extension provides overloads /// of these casting methods that are restricted to the same base node type. -/// Furthermore, it marks the inherited casting methods from ``SyntaxProtocol`` as +/// Furthermore, it marks the inherited casting methods from ``SyntaxProtocol`` as /// deprecated, indicating that they will always fail when used in this context. extension DeclSyntaxProtocol { /// Checks if the current syntax node can be cast to a given specialized syntax type. @@ -184,9 +184,8 @@ public struct DeclSyntax: DeclSyntaxProtocol, SyntaxHashable { /// Create a ``DeclSyntax`` node from a specialized syntax node. public init(_ syntax: __shared some DeclSyntaxProtocol) { - // We know this cast is going to succeed. Go through init(_: SyntaxData) - // to do a sanity check and verify the kind matches in debug builds and get - // maximum performance in release builds. + // We know this cast is going to succeed. Go through `init(_: SyntaxData)` just to double-check and + // verify the kind matches in debug builds and get maximum performance in release builds. self = Syntax(syntax).cast(Self.self) } @@ -199,9 +198,8 @@ public struct DeclSyntax: DeclSyntaxProtocol, SyntaxHashable { } public init(fromProtocol syntax: __shared DeclSyntaxProtocol) { - // We know this cast is going to succeed. Go through init(_: SyntaxData) - // to do a sanity check and verify the kind matches in debug builds and get - // maximum performance in release builds. + // We know this cast is going to succeed. Go through `init(_: SyntaxData)` just to double-check and + // verify the kind matches in debug builds and get maximum performance in release builds. self = Syntax(syntax).cast(Self.self) } @@ -327,7 +325,7 @@ public protocol ExprSyntaxProtocol: SyntaxProtocol {} /// These methods enable casting between syntax node types within the same /// base node protocol hierarchy (e.g., ``DeclSyntaxProtocol``). /// -/// While ``SyntaxProtocol`` offers general casting methods (``SyntaxProtocol.as(_:)``, +/// While ``SyntaxProtocol`` offers general casting methods (``SyntaxProtocol.as(_:)``, /// ``SyntaxProtocol.is(_:)``, and ``SyntaxProtocol.cast(_:)``), these often aren't /// appropriate for use on types conforming to a specific base node protocol /// like ``ExprSyntaxProtocol``. That's because at this level, @@ -336,7 +334,7 @@ public protocol ExprSyntaxProtocol: SyntaxProtocol {} /// /// To guide developers toward correct usage, this extension provides overloads /// of these casting methods that are restricted to the same base node type. -/// Furthermore, it marks the inherited casting methods from ``SyntaxProtocol`` as +/// Furthermore, it marks the inherited casting methods from ``SyntaxProtocol`` as /// deprecated, indicating that they will always fail when used in this context. extension ExprSyntaxProtocol { /// Checks if the current syntax node can be cast to a given specialized syntax type. @@ -512,9 +510,8 @@ public struct ExprSyntax: ExprSyntaxProtocol, SyntaxHashable { /// Create a ``ExprSyntax`` node from a specialized syntax node. public init(_ syntax: __shared some ExprSyntaxProtocol) { - // We know this cast is going to succeed. Go through init(_: SyntaxData) - // to do a sanity check and verify the kind matches in debug builds and get - // maximum performance in release builds. + // We know this cast is going to succeed. Go through `init(_: SyntaxData)` just to double-check and + // verify the kind matches in debug builds and get maximum performance in release builds. self = Syntax(syntax).cast(Self.self) } @@ -527,9 +524,8 @@ public struct ExprSyntax: ExprSyntaxProtocol, SyntaxHashable { } public init(fromProtocol syntax: __shared ExprSyntaxProtocol) { - // We know this cast is going to succeed. Go through init(_: SyntaxData) - // to do a sanity check and verify the kind matches in debug builds and get - // maximum performance in release builds. + // We know this cast is going to succeed. Go through `init(_: SyntaxData)` just to double-check and + // verify the kind matches in debug builds and get maximum performance in release builds. self = Syntax(syntax).cast(Self.self) } @@ -685,7 +681,7 @@ public protocol PatternSyntaxProtocol: SyntaxProtocol {} /// These methods enable casting between syntax node types within the same /// base node protocol hierarchy (e.g., ``DeclSyntaxProtocol``). /// -/// While ``SyntaxProtocol`` offers general casting methods (``SyntaxProtocol.as(_:)``, +/// While ``SyntaxProtocol`` offers general casting methods (``SyntaxProtocol.as(_:)``, /// ``SyntaxProtocol.is(_:)``, and ``SyntaxProtocol.cast(_:)``), these often aren't /// appropriate for use on types conforming to a specific base node protocol /// like ``PatternSyntaxProtocol``. That's because at this level, @@ -694,7 +690,7 @@ public protocol PatternSyntaxProtocol: SyntaxProtocol {} /// /// To guide developers toward correct usage, this extension provides overloads /// of these casting methods that are restricted to the same base node type. -/// Furthermore, it marks the inherited casting methods from ``SyntaxProtocol`` as +/// Furthermore, it marks the inherited casting methods from ``SyntaxProtocol`` as /// deprecated, indicating that they will always fail when used in this context. extension PatternSyntaxProtocol { /// Checks if the current syntax node can be cast to a given specialized syntax type. @@ -826,9 +822,8 @@ public struct PatternSyntax: PatternSyntaxProtocol, SyntaxHashable { /// Create a ``PatternSyntax`` node from a specialized syntax node. public init(_ syntax: __shared some PatternSyntaxProtocol) { - // We know this cast is going to succeed. Go through init(_: SyntaxData) - // to do a sanity check and verify the kind matches in debug builds and get - // maximum performance in release builds. + // We know this cast is going to succeed. Go through `init(_: SyntaxData)` just to double-check and + // verify the kind matches in debug builds and get maximum performance in release builds. self = Syntax(syntax).cast(Self.self) } @@ -841,9 +836,8 @@ public struct PatternSyntax: PatternSyntaxProtocol, SyntaxHashable { } public init(fromProtocol syntax: __shared PatternSyntaxProtocol) { - // We know this cast is going to succeed. Go through init(_: SyntaxData) - // to do a sanity check and verify the kind matches in debug builds and get - // maximum performance in release builds. + // We know this cast is going to succeed. Go through `init(_: SyntaxData)` just to double-check and + // verify the kind matches in debug builds and get maximum performance in release builds. self = Syntax(syntax).cast(Self.self) } @@ -952,7 +946,7 @@ public protocol StmtSyntaxProtocol: SyntaxProtocol {} /// These methods enable casting between syntax node types within the same /// base node protocol hierarchy (e.g., ``DeclSyntaxProtocol``). /// -/// While ``SyntaxProtocol`` offers general casting methods (``SyntaxProtocol.as(_:)``, +/// While ``SyntaxProtocol`` offers general casting methods (``SyntaxProtocol.as(_:)``, /// ``SyntaxProtocol.is(_:)``, and ``SyntaxProtocol.cast(_:)``), these often aren't /// appropriate for use on types conforming to a specific base node protocol /// like ``StmtSyntaxProtocol``. That's because at this level, @@ -961,7 +955,7 @@ public protocol StmtSyntaxProtocol: SyntaxProtocol {} /// /// To guide developers toward correct usage, this extension provides overloads /// of these casting methods that are restricted to the same base node type. -/// Furthermore, it marks the inherited casting methods from ``SyntaxProtocol`` as +/// Furthermore, it marks the inherited casting methods from ``SyntaxProtocol`` as /// deprecated, indicating that they will always fail when used in this context. extension StmtSyntaxProtocol { /// Checks if the current syntax node can be cast to a given specialized syntax type. @@ -1102,9 +1096,8 @@ public struct StmtSyntax: StmtSyntaxProtocol, SyntaxHashable { /// Create a ``StmtSyntax`` node from a specialized syntax node. public init(_ syntax: __shared some StmtSyntaxProtocol) { - // We know this cast is going to succeed. Go through init(_: SyntaxData) - // to do a sanity check and verify the kind matches in debug builds and get - // maximum performance in release builds. + // We know this cast is going to succeed. Go through `init(_: SyntaxData)` just to double-check and + // verify the kind matches in debug builds and get maximum performance in release builds. self = Syntax(syntax).cast(Self.self) } @@ -1117,9 +1110,8 @@ public struct StmtSyntax: StmtSyntaxProtocol, SyntaxHashable { } public init(fromProtocol syntax: __shared StmtSyntaxProtocol) { - // We know this cast is going to succeed. Go through init(_: SyntaxData) - // to do a sanity check and verify the kind matches in debug builds and get - // maximum performance in release builds. + // We know this cast is going to succeed. Go through `init(_: SyntaxData)` just to double-check and + // verify the kind matches in debug builds and get maximum performance in release builds. self = Syntax(syntax).cast(Self.self) } @@ -1238,7 +1230,7 @@ public protocol TypeSyntaxProtocol: SyntaxProtocol {} /// These methods enable casting between syntax node types within the same /// base node protocol hierarchy (e.g., ``DeclSyntaxProtocol``). /// -/// While ``SyntaxProtocol`` offers general casting methods (``SyntaxProtocol.as(_:)``, +/// While ``SyntaxProtocol`` offers general casting methods (``SyntaxProtocol.as(_:)``, /// ``SyntaxProtocol.is(_:)``, and ``SyntaxProtocol.cast(_:)``), these often aren't /// appropriate for use on types conforming to a specific base node protocol /// like ``TypeSyntaxProtocol``. That's because at this level, @@ -1247,7 +1239,7 @@ public protocol TypeSyntaxProtocol: SyntaxProtocol {} /// /// To guide developers toward correct usage, this extension provides overloads /// of these casting methods that are restricted to the same base node type. -/// Furthermore, it marks the inherited casting methods from ``SyntaxProtocol`` as +/// Furthermore, it marks the inherited casting methods from ``SyntaxProtocol`` as /// deprecated, indicating that they will always fail when used in this context. extension TypeSyntaxProtocol { /// Checks if the current syntax node can be cast to a given specialized syntax type. @@ -1390,9 +1382,8 @@ public struct TypeSyntax: TypeSyntaxProtocol, SyntaxHashable { /// Create a ``TypeSyntax`` node from a specialized syntax node. public init(_ syntax: __shared some TypeSyntaxProtocol) { - // We know this cast is going to succeed. Go through init(_: SyntaxData) - // to do a sanity check and verify the kind matches in debug builds and get - // maximum performance in release builds. + // We know this cast is going to succeed. Go through `init(_: SyntaxData)` just to double-check and + // verify the kind matches in debug builds and get maximum performance in release builds. self = Syntax(syntax).cast(Self.self) } @@ -1405,9 +1396,8 @@ public struct TypeSyntax: TypeSyntaxProtocol, SyntaxHashable { } public init(fromProtocol syntax: __shared TypeSyntaxProtocol) { - // We know this cast is going to succeed. Go through init(_: SyntaxData) - // to do a sanity check and verify the kind matches in debug builds and get - // maximum performance in release builds. + // We know this cast is going to succeed. Go through `init(_: SyntaxData)` just to double-check and + // verify the kind matches in debug builds and get maximum performance in release builds. self = Syntax(syntax).cast(Self.self) } diff --git a/SwiftParserCLI/Sources/swift-parser-cli/Commands/Reduce.swift b/SwiftParserCLI/Sources/swift-parser-cli/Commands/Reduce.swift index 393df87845d..aeb7301a546 100644 --- a/SwiftParserCLI/Sources/swift-parser-cli/Commands/Reduce.swift +++ b/SwiftParserCLI/Sources/swift-parser-cli/Commands/Reduce.swift @@ -97,7 +97,7 @@ struct Reduce: ParsableCommand { #if os(Windows) _ = TerminateProcess(process.processHandle, 0) #else - kill(pid_t(process.processIdentifier), SIGKILL) + kill(pid_t(process.processIdentifier), SIGKILL) // ignore-unacceptable-language #endif return .timeout } diff --git a/SwiftSyntaxDevUtils/Sources/swift-syntax-dev-utils/commands/VerifySourceCode.swift b/SwiftSyntaxDevUtils/Sources/swift-syntax-dev-utils/commands/VerifySourceCode.swift index 5f339341ae0..02c66d15e2f 100644 --- a/SwiftSyntaxDevUtils/Sources/swift-syntax-dev-utils/commands/VerifySourceCode.swift +++ b/SwiftSyntaxDevUtils/Sources/swift-syntax-dev-utils/commands/VerifySourceCode.swift @@ -138,7 +138,7 @@ struct VerifySpiYmlExecutor { /// a dependency from this script on a YAML parser and that just doesn’t seem worth it. private func targetsInSwiftPackageIndexManifest() throws -> [String] { let extractTargetRegex = Regex { - #/^ - /# + #/^ - /# Capture(ZeroOrMore(.word)) #/$/# } diff --git a/api-breakages.txt b/api-breakages.txt new file mode 100644 index 00000000000..4f5611e7187 --- /dev/null +++ b/api-breakages.txt @@ -0,0 +1,2 @@ +6.2 +---