diff --git a/.github/ISSUE_TEMPLATE/BASICFORMAT_BUG.yml b/.github/ISSUE_TEMPLATE/BASICFORMAT_BUG.yml index 6ceb4355bd8..a2c8f864f8e 100644 --- a/.github/ISSUE_TEMPLATE/BASICFORMAT_BUG.yml +++ b/.github/ISSUE_TEMPLATE/BASICFORMAT_BUG.yml @@ -4,7 +4,7 @@ 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/apple/swift-syntax/main/documentation/swiftbasicformat/filingbugreports). + 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: diff --git a/.github/ISSUE_TEMPLATE/PARSER_BUG.yml b/.github/ISSUE_TEMPLATE/PARSER_BUG.yml index 9209d31340f..7cf33b92d27 100644 --- a/.github/ISSUE_TEMPLATE/PARSER_BUG.yml +++ b/.github/ISSUE_TEMPLATE/PARSER_BUG.yml @@ -4,12 +4,12 @@ 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/apple/swift-syntax/main/documentation/swiftparser/filingbugreports). + 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/apple/swift-syntax/main/documentation/swiftparser/filingbugreports) for more details. + 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 diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index f764474c665..abe51dbfea7 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -11,5 +11,5 @@ 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/apple/swift-syntax/documentation/swiftsyntax + url: https://swiftpackageindex.com/swiftlang/swift-syntax/documentation/swiftsyntax about: Learn about how to use the SwiftSyntax in your projects diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6468ca3f23c..7df8bbb11c1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,7 +19,7 @@ swift-syntax is a SwiftPM package, so you can build and test it using anything t ## Formatting -swift-syntax is formatted using [swift-format](http://github.com/apple/swift-format) to ensure a consistent style. +swift-syntax is formatted using [swift-format](http://github.com/swiftlang/swift-format) to ensure a consistent style. To format your changes run the formatter using the following command ```bash diff --git a/CodeGeneration/Package.swift b/CodeGeneration/Package.swift index 293967ec963..8b2fd91d437 100644 --- a/CodeGeneration/Package.swift +++ b/CodeGeneration/Package.swift @@ -12,7 +12,7 @@ let package = Package( .executable(name: "generate-swift-syntax", targets: ["generate-swift-syntax"]) ], dependencies: [ - .package(url: "https://github.com/apple/swift-syntax", from: "510.0.0"), + .package(url: "https://github.com/swiftlang/swift-syntax", from: "510.0.0"), .package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.2.2"), ], targets: [ diff --git a/CodeGeneration/Sources/SyntaxSupport/Child.swift b/CodeGeneration/Sources/SyntaxSupport/Child.swift index 74b7e3f3a6a..c5d803f1b21 100644 --- a/CodeGeneration/Sources/SyntaxSupport/Child.swift +++ b/CodeGeneration/Sources/SyntaxSupport/Child.swift @@ -197,7 +197,7 @@ public class Child { The old string-based implementation returned "Token" to ensure that `tokenKind` is not nil and that `isToken` computed-property will return true, but the value "Token" had never been used in other cases. We should try to remove this computed property altogether in the issue: - https://github.com/apple/swift-syntax/issues/2010 + https://github.com/swiftlang/swift-syntax/issues/2010 */ return .unknown } diff --git a/Examples/README.md b/Examples/README.md index c8a8fb1657a..42805c57cc4 100644 --- a/Examples/README.md +++ b/Examples/README.md @@ -23,8 +23,8 @@ Furthermore, SwiftSyntax uses [`SwiftSyntaxBuilder`](../Sources/SwiftSyntaxBuild [**Swift AST Explorer**](https://swift-ast-explorer.com/): A Swift AST visualizer. -[**Swift Stress Tester**](https://github.com/apple/swift-stress-tester): A test driver for `sourcekitd` and Swift evolution. +[**Swift Stress Tester**](https://github.com/swiftlang/swift-stress-tester): A test driver for `sourcekitd` and Swift evolution. -[**swift-format**](https://github.com/apple/swift-format): Formatting technology for Swift source code. +[**swift-format**](https://github.com/swiftlang/swift-format): Formatting technology for Swift source code. [**SwiftLint**](https://github.com/realm/SwiftLint): A tool to enforce Swift style and conventions. diff --git a/README.md b/README.md index 18d211b4005..c477c3ac70c 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ The swift-syntax package is a set of libraries that work on a source-accurate tr ## Documentation -You can read SwiftSyntax’s documentation on [swiftpackageindex.com](https://swiftpackageindex.com/apple/swift-syntax/documentation). +You can read SwiftSyntax’s documentation on [swiftpackageindex.com](https://swiftpackageindex.com/swiftlang/swift-syntax/documentation). A great way to interactively explore the SwiftSyntax tree of a source file is https://swift-ast-explorer.com, developed by [@kishikawakatsumi](https://github.com/kishikawakatsumi). @@ -19,15 +19,15 @@ To depend on swift-syntax in a SwiftPM package, add the following to your `Packa ```swift dependencies: [ - .package(url: "https://github.com/apple/swift-syntax.git", from: "<#latest swift-syntax tag#>"), + .package(url: "https://github.com/swiftlang/swift-syntax.git", from: "<#latest swift-syntax tag#>"), ], ``` -To add swift-syntax as a dependency of your Xcode project, go to the *Package Dependencies* tab of your Xcode project, click the plus button and search for https://github.com/apple/swift-syntax.git. +To add swift-syntax as a dependency of your Xcode project, go to the *Package Dependencies* tab of your Xcode project, click the plus button and search for https://github.com/swiftlang/swift-syntax.git. ## Reporting Issues -If you should hit any issues while using SwiftSyntax, we appreciate bug reports on [GitHub Issue](https://github.com/apple/swift-syntax/issues). +If you should hit any issues while using SwiftSyntax, we appreciate bug reports on [GitHub Issue](https://github.com/swiftlang/swift-syntax/issues). ## Contributing @@ -42,7 +42,7 @@ into your `WORKSPACE` and depend on the libraries you need from the `Library_opt` target (such as `SwiftSyntax_opt`) which forces SwiftSyntax to always build with optimizations enabled. This may help local runtime performance at the cost of debuggability, and initial -build time. Please tag any [issues](https://github.com/apple/swift-syntax/issues) related to the Bazel configuration with the label "Bazel". +build time. Please tag any [issues](https://github.com/swiftlang/swift-syntax/issues) related to the Bazel configuration with the label "Bazel". ## License diff --git a/Release Notes/600.md b/Release Notes/600.md index 1160bfcbd7f..677d39f919f 100644 --- a/Release Notes/600.md +++ b/Release Notes/600.md @@ -3,101 +3,101 @@ ## 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: https://github.com/apple/sourcekit-lsp/issues/909 - - Pull Request: https://github.com/apple/swift-syntax/pull/2314 + - Issue: https://github.com/swiftlang/sourcekit-lsp/issues/909 + - Pull Request: https://github.com/swiftlang/swift-syntax/pull/2314 - `SourceEdit` - Description: `SourceEdit` has been moved from SwiftRefactor to SwiftSyntax - - Issue: https://github.com/apple/sourcekit-lsp/issues/909 - - Pull Request: https://github.com/apple/swift-syntax/pull/2314 + - Issue: https://github.com/swiftlang/sourcekit-lsp/issues/909 + - Pull Request: https://github.com/swiftlang/swift-syntax/pull/2314 - `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: https://github.com/apple/swift-syntax/issues/2015 - - Pull Request: https://github.com/apple/swift-syntax/pull/2021 + - Issue: https://github.com/swiftlang/swift-syntax/issues/2015 + - Pull Request: https://github.com/swiftlang/swift-syntax/pull/2021 - `DeclSyntaxEnum`, `StmtSyntaxEnum`, `ExprSyntaxEnum`, `TypeSyntaxEnum`, and `PatternSyntaxEnum` - Description: Enum to exhaustively switch over all different syntax nodes of each base type. - - Pull Request: https://github.com/apple/swift-syntax/pull/2351 + - Pull Request: https://github.com/swiftlang/swift-syntax/pull/2351 - `WithOptionalCodeBlock` - Description: A trait for syntax nodes that have an optional code block, such as `FunctionDeclSyntax` and `InitializerDeclSyntax`. - - Pull Request: https://github.com/apple/swift-syntax/pull/2359 + - Pull Request: https://github.com/swiftlang/swift-syntax/pull/2359 - `CodeBlockSyntax` - Description: `CodeBlockSyntax` is now `SyntaxParseable`, so it can be used with string interpolations. - - Pull Request: https://github.com/apple/swift-syntax/pull/2361 + - Pull Request: https://github.com/swiftlang/swift-syntax/pull/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: https://github.com/apple/swift-syntax/pull/2379 + - Pull Request: https://github.com/swiftlang/swift-syntax/pull/2379 - `String.isValidIdentifier(for:)` - Description: `SwiftParser` adds an extension on `String` to check if it can be used as an identifier in a given context. - - Pull Request: https://github.com/apple/swift-syntax/pull/2434 + - Pull Request: https://github.com/swiftlang/swift-syntax/pull/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: https://github.com/apple/swift-syntax/pull/2450 + - Pull Request: https://github.com/swiftlang/swift-syntax/pull/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: https://github.com/apple/swift-syntax/pull/1554 + - Pull request: https://github.com/swiftlang/swift-syntax/pull/1554 - `TriviaPiece.isComment` - Description: `TriviaPiece` now has a computed property `isComment` that returns `true` if the trivia piece is a comment. - - Pull Request: https://github.com/apple/swift-syntax/pull/2469 + - Pull Request: https://github.com/swiftlang/swift-syntax/pull/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: https://github.com/apple/swift-syntax/issues/2031 - - Pull Request: https://github.com/apple/swift-syntax/pull/2327 + - Issue: https://github.com/swiftlang/swift-syntax/issues/2031 + - Pull Request: https://github.com/swiftlang/swift-syntax/pull/2327 - `BasicFormat.inferIndentation(of:)` - Description: Uses heuristics to infer the indentation width used in a syntax tree. - - Pull Request: https://github.com/apple/swift-syntax/pull/2514 + - Pull Request: https://github.com/swiftlang/swift-syntax/pull/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: https://github.com/apple/swift-syntax/pull/2527 + - 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/apple/swift-syntax/pull/2433 + - Pull request: https://github.com/swiftlang/swift-syntax/pull/2433 - `DeclGroupSyntax.introducer` - Description: The `DeclGroupSyntax` trait has an extra `introducer` property, ie. the keyword that introduces the declaration. - - Issue: https://github.com/apple/sourcekit-lsp/issues/2535 - - Pull Request: https://github.com/apple/swift-syntax/pull/2539 + - Issue: https://github.com/swiftlang/sourcekit-lsp/issues/2535 + - Pull Request: https://github.com/swiftlang/swift-syntax/pull/2539 - `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/apple/swift-syntax/pull/2025 + - Pull request: https://github.com/swiftlang/swift-syntax/pull/2025 - `SyntaxProtocol.node(at:)` - Description: Given a `SyntaxIdentifier`, returns the `Syntax` node with that identifier - - Pull request: https://github.com/apple/swift-syntax/pull/2594 + - Pull request: https://github.com/swiftlang/swift-syntax/pull/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: https://github.com/apple/swift-syntax/pull/2594 + - Pull request: https://github.com/swiftlang/swift-syntax/pull/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: https://github.com/apple/swift-syntax/pull/2594 + - Pull request: https://github.com/swiftlang/swift-syntax/pull/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: https://github.com/apple/swift-syntax/pull/2594 + - 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/apple/swift-syntax/pull/2647 + - Pull request: https://github.com/swiftlang/swift-syntax/pull/2647 - `TokenSyntax.identifier` - Description: Adds an `identifier` property to `TokenSyntax` which returns a canonicalized representation of an identifier that strips away backticks. - - Pull request: https://github.com/apple/swift-syntax/pull/2576 + - Pull request: https://github.com/swiftlang/swift-syntax/pull/2576 ## API Behavior Changes @@ -105,84 +105,84 @@ - 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: https://github.com/apple/swift-syntax/issues/2092 - - Pull Request: https://github.com/apple/swift-syntax/pull/2184 + - Issue: https://github.com/swiftlang/swift-syntax/issues/2092 + - Pull Request: https://github.com/swiftlang/swift-syntax/pull/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: https://github.com/apple/swift-syntax/issues/2267 - - Pull request: https://github.com/apple/swift-syntax/pull/2272 + - Issue: https://github.com/swiftlang/swift-syntax/issues/2267 + - Pull request: https://github.com/swiftlang/swift-syntax/pull/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: https://github.com/apple/swift-syntax/pull/2338 + - 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/apple/swift-syntax/pull/2237 + - Pull request: https://github.com/swiftlang/swift-syntax/pull/2237 - `AttributedTypeSyntax.specifier` has renamed to `specifiers` and changed to be a collection - Description: Types can have multiple specifiers now and the syntax tree has been modified to reflect that. - - Pull request: https://github.com/apple/swift-syntax/pull/2433 + - Pull request: https://github.com/swiftlang/swift-syntax/pull/2433 - ` 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/apple/swift-syntax/pull/2025 + - 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/apple/swift-syntax/pull/2450 + - 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/apple/swift-syntax/pull/2219 + - 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/apple/swift-syntax/pull/2292 + - 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/apple/swift-syntax/pull/2292 + - 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/apple/swift-syntax/issues/2267 - - Pull request: https://github.com/apple/swift-syntax/pull/2272 + - 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/apple/swift-syntax/pull/2375 + - 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` - The new cases cover the newly introduced `ThrowsClauseSyntax` - - Pull request: https://github.com/apple/swift-syntax/pull/2379 + - Pull request: https://github.com/swiftlang/swift-syntax/pull/2379 - Migration steps: In exhaustive switches over `SyntaxEnum` and `SyntaxKind`, cover the new case. - `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/apple/swift-syntax/pull/1554 + - 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 - Description: `TriviaPiece.isBackslash` was not intended to be public API. - - Pull request: https://github.com/apple/swift-syntax/pull/2531 + - Pull request: https://github.com/swiftlang/swift-syntax/pull/2531 - Migration steps: Use `if case .backslash = triviaPiece` instead - All symbols in `SwiftCompilerPluginMessageHandling` are now SPI - Description: This module is only intended to be used from some internal components. Any other modules should not use them directly. - - Pull request: https://github.com/apple/swift-syntax/pull/2489 + - Pull request: https://github.com/swiftlang/swift-syntax/pull/2489 - Migration steps: Stop using this module. ## Template diff --git a/Sources/SwiftBasicFormat/SwiftBasicFormat.docc/FilingBugReports.md b/Sources/SwiftBasicFormat/SwiftBasicFormat.docc/FilingBugReports.md index 3c6179ab246..a79eccaaa66 100644 --- a/Sources/SwiftBasicFormat/SwiftBasicFormat.docc/FilingBugReports.md +++ b/Sources/SwiftBasicFormat/SwiftBasicFormat.docc/FilingBugReports.md @@ -15,4 +15,4 @@ or openning `SwiftParserCLI` package and building the `swift-parser-cli` target swift-parser-cli basic-format /path/to/file/that/formats/incorrectly.swift ``` 2. Remove as much code from your source file while still experiencing the formatting issue. -3. File a bug report on with the reduced source code. +3. File a bug report on with the reduced source code. diff --git a/Sources/SwiftParser/SwiftParser.docc/FilingBugReports.md b/Sources/SwiftParser/SwiftParser.docc/FilingBugReports.md index 915afc1ab19..7a9b2bafb6e 100644 --- a/Sources/SwiftParser/SwiftParser.docc/FilingBugReports.md +++ b/Sources/SwiftParser/SwiftParser.docc/FilingBugReports.md @@ -12,7 +12,7 @@ If you encounter a case where printing the parsed syntax tree does not reproduce ``` swift-parser-cli reduce /pth/to/file/that/does/not/roundtrip.swift ``` -2. File a bug report on with the reduced source code or fix the issue yourself by following the steps in . +2. File a bug report on with the reduced source code or fix the issue yourself by following the steps in . ## Parse of Valid Source Failed or Bad Diagnostic Produced @@ -23,7 +23,7 @@ If you have source code that is parsed correctly by the current Swift compiler ( swift-parser-cli print-diags /path/to/file.swift ``` 2. Remove as much code as possible from your test file and check if it still produces the same diagnostic. -3. File a bug report on with the reduced source code or fix the issue yourself by following the steps in . +3. File a bug report on with the reduced source code or fix the issue yourself by following the steps in . ## Parse of Valid Source Code Produced an Invalid Syntax Tree @@ -34,4 +34,4 @@ If you have valid source code that produced a syntax tree which doesn’t repres swift-parser-cli print-tree /path/to/file.swift ``` 2. Remove as much code as possible from your test file and check if it still produces the same invalid tree -3. File a bug report on with the reduced source code or fix the issue yourself by following the steps in . +3. File a bug report on with the reduced source code or fix the issue yourself by following the steps in . diff --git a/Sources/SwiftSyntax/Documentation.docc/Contributing/ChangingSwiftSyntax.md b/Sources/SwiftSyntax/Documentation.docc/Contributing/ChangingSwiftSyntax.md index dfeabbfe5d4..af35b3564f5 100644 --- a/Sources/SwiftSyntax/Documentation.docc/Contributing/ChangingSwiftSyntax.md +++ b/Sources/SwiftSyntax/Documentation.docc/Contributing/ChangingSwiftSyntax.md @@ -73,9 +73,9 @@ nodes will need to be changed in tandem. For example, the system will not allow changes to SwiftSyntax that break `swift-stress-tester` without a paired change to that repository. -[SyntaxSupport]: https://github.com/apple/swift-syntax/tree/main/CodeGeneration/Sources/SyntaxSupport -[swift-stress-tester]: https://github.com/apple/swift-stress-tester -[ParserBasics]: https://github.com/apple/swift-syntax/tree/main/Sources/SwiftParser/SwiftParser.docc/ParsingBasics.md +[SyntaxSupport]: https://github.com/swiftlang/swift-syntax/tree/main/CodeGeneration/Sources/SyntaxSupport +[swift-stress-tester]: https://github.com/swiftlang/swift-stress-tester +[ParserBasics]: https://github.com/swiftlang/swift-syntax/tree/main/Sources/SwiftParser/SwiftParser.docc/ParsingBasics.md @Comment { When docc resolves https://github.com/apple/swift-docc/issues/255, `ParserBasic` should be an inter-target link. diff --git a/Sources/SwiftSyntax/Documentation.docc/Macro Versioning.md b/Sources/SwiftSyntax/Documentation.docc/Macro Versioning.md index ff25aa65329..fe96bc4a94d 100644 --- a/Sources/SwiftSyntax/Documentation.docc/Macro Versioning.md +++ b/Sources/SwiftSyntax/Documentation.docc/Macro Versioning.md @@ -15,7 +15,7 @@ For simplicity, this article assumes that 509 is the current swift-syntax versio Any given version macro can depend on multiple major swift-syntax versions at once. For example, if a macro supports both swift-syntax 509 and swift-syntax 510, it may declare its dependency on swift-syntax as ``` -.package(url: "https://github.com/apple/swift-syntax.git", "509.0.0"..<"511.0.0"), +.package(url: "https://github.com/swiftlang/swift-syntax.git", "509.0.0"..<"511.0.0"), ``` In order to handle breaking API changes, clients can wrap uses of such APIs in conditional compilation clauses that check the version of swift-syntax it is building against. All versions of swift-syntax ≥ 509 will include an empty `SwiftSyntaxVersion509` module, swift-syntax ≥ 510 will include both a `SwiftSyntaxVersion510` and `SwiftSyntaxVersion509` module, and so on for any new releases. This allows clients to write diff --git a/Sources/SwiftSyntax/Documentation.docc/Resources/Package.step3.swift b/Sources/SwiftSyntax/Documentation.docc/Resources/Package.step3.swift index 9bac75daa90..bb572c9659a 100644 --- a/Sources/SwiftSyntax/Documentation.docc/Resources/Package.step3.swift +++ b/Sources/SwiftSyntax/Documentation.docc/Resources/Package.step3.swift @@ -14,7 +14,7 @@ let package = Package( ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/apple/swift-syntax.git", branch: "main") + .package(url: "https://github.com/swiftlang/swift-syntax.git", branch: "main") ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. diff --git a/Sources/SwiftSyntax/Documentation.docc/Resources/Package.step4.swift b/Sources/SwiftSyntax/Documentation.docc/Resources/Package.step4.swift index 920de5f4bdd..131b4f36a90 100644 --- a/Sources/SwiftSyntax/Documentation.docc/Resources/Package.step4.swift +++ b/Sources/SwiftSyntax/Documentation.docc/Resources/Package.step4.swift @@ -14,7 +14,7 @@ let package = Package( ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/apple/swift-syntax.git", branch: "main") + .package(url: "https://github.com/swiftlang/swift-syntax.git", branch: "main") ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. diff --git a/Sources/SwiftSyntax/Documentation.docc/Resources/Package.step5.swift b/Sources/SwiftSyntax/Documentation.docc/Resources/Package.step5.swift index ea36b7480eb..dc392b00c05 100644 --- a/Sources/SwiftSyntax/Documentation.docc/Resources/Package.step5.swift +++ b/Sources/SwiftSyntax/Documentation.docc/Resources/Package.step5.swift @@ -17,7 +17,7 @@ let package = Package( ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/apple/swift-syntax.git", branch: "main") + .package(url: "https://github.com/swiftlang/swift-syntax.git", branch: "main") ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. diff --git a/SwiftSyntaxDevUtils/Sources/swift-syntax-dev-utils/commands/Format.swift b/SwiftSyntaxDevUtils/Sources/swift-syntax-dev-utils/commands/Format.swift index 17252a94f85..145006cf7a4 100644 --- a/SwiftSyntaxDevUtils/Sources/swift-syntax-dev-utils/commands/Format.swift +++ b/SwiftSyntaxDevUtils/Sources/swift-syntax-dev-utils/commands/Format.swift @@ -167,7 +167,7 @@ struct FormatExecutor { try runGitCommand("pull") } else { try FileManager.default.createDirectory(atPath: Paths.swiftFormatBuildDir.path, withIntermediateDirectories: true) - try runGitCommand("clone", "https://github.com/apple/swift-format.git", ".") + try runGitCommand("clone", "https://github.com/swiftlang/swift-format.git", ".") try runGitCommand("checkout", Self.swiftFormatBranch) } try runSwiftCommand("package", "update") diff --git a/Tests/SwiftParserTest/DeclarationTests.swift b/Tests/SwiftParserTest/DeclarationTests.swift index f1c71339d82..427d4a0e3f3 100644 --- a/Tests/SwiftParserTest/DeclarationTests.swift +++ b/Tests/SwiftParserTest/DeclarationTests.swift @@ -3105,7 +3105,7 @@ final class DeclarationTests: ParserTestCase { ) } - // https://github.com/apple/swift-syntax/issues/2273 + // https://github.com/swiftlang/swift-syntax/issues/2273 func testEnumCaseWithGenericParameter() { assertParse( """ diff --git a/Tests/SwiftParserTest/StatementTests.swift b/Tests/SwiftParserTest/StatementTests.swift index 5a5752946cc..cd82807bb01 100644 --- a/Tests/SwiftParserTest/StatementTests.swift +++ b/Tests/SwiftParserTest/StatementTests.swift @@ -676,7 +676,7 @@ final class StatementTests: ParserTestCase { } func testSkippingOverEmptyStringLiteral() { - // https://github.com/apple/swift-syntax/issues/1247 + // https://github.com/swiftlang/swift-syntax/issues/1247 assertParse( """ if pℹ️{""1️⃣ diff --git a/Tests/SwiftParserTest/translated/RecoveryTests.swift b/Tests/SwiftParserTest/translated/RecoveryTests.swift index 6a9c96a1452..93ce16e2c43 100644 --- a/Tests/SwiftParserTest/translated/RecoveryTests.swift +++ b/Tests/SwiftParserTest/translated/RecoveryTests.swift @@ -3315,7 +3315,7 @@ final class RecoveryTests: ParserTestCase { ) } - // https://github.com/apple/swift-syntax/issues/1483 + // https://github.com/swiftlang/swift-syntax/issues/1483 func testRecovery183() { // Can be parsed and produces no diagnostics. assertParse( @@ -3346,7 +3346,7 @@ final class RecoveryTests: ParserTestCase { ) } - // https://github.com/apple/swift-syntax/pull/1484/files#r1176740738 + // https://github.com/swiftlang/swift-syntax/pull/1484/files#r1176740738 func testRecovery184() { assertParse( "func foo() -> Int1️⃣:", diff --git a/Tests/SwiftRefactorTest/CallToTrailingClosureTests.swift b/Tests/SwiftRefactorTest/CallToTrailingClosureTests.swift index 4c32c79c1dd..06cc7984da4 100644 --- a/Tests/SwiftRefactorTest/CallToTrailingClosureTests.swift +++ b/Tests/SwiftRefactorTest/CallToTrailingClosureTests.swift @@ -80,7 +80,7 @@ final class CallToTrailingClosuresTest: XCTestCase { """ // TODO: The ident here is not great. - // https://github.com/apple/swift-syntax/issues/1473 + // https://github.com/swiftlang/swift-syntax/issues/1473 let expected: ExprSyntax = """ foo({ label in return 1 diff --git a/Tests/SwiftSyntaxBuilderTest/VariableTests.swift b/Tests/SwiftSyntaxBuilderTest/VariableTests.swift index e2b6905de63..8aeaaad5d2a 100644 --- a/Tests/SwiftSyntaxBuilderTest/VariableTests.swift +++ b/Tests/SwiftSyntaxBuilderTest/VariableTests.swift @@ -389,7 +389,7 @@ final class VariableTests: XCTestCase { } } - // https://github.com/apple/swift-syntax/issues/1815 + // https://github.com/swiftlang/swift-syntax/issues/1815 func testSpacingInDictionaryType() throws { let buildable = try VariableDeclSyntax("static var mirror: Dictionary") {} diff --git a/Tests/SwiftSyntaxTest/SourceLocationConverterTests.swift b/Tests/SwiftSyntaxTest/SourceLocationConverterTests.swift index b826fcae29d..b2144e13f98 100644 --- a/Tests/SwiftSyntaxTest/SourceLocationConverterTests.swift +++ b/Tests/SwiftSyntaxTest/SourceLocationConverterTests.swift @@ -206,7 +206,7 @@ final class SourceLocationConverterTests: XCTestCase { // FIXME: The current parser handles this fine but it’s a really bogus filename. // We ignore the directive because the multi-line string literal contains multiple segments. // We should probably justs disallow multi-line string literals for the `file` argument. - // cf https://github.com/apple/swift-syntax/issues/1831 + // cf https://github.com/swiftlang/swift-syntax/issues/1831 assertPresumedSourceLocation( #""" #sourceLocation(file: """