# Swift Syntax

**URL:** https://forums.swift.org/c/development/swift-syntax/112.md

[Latest](https://forums.swift.org/latest.md) · [Categories](https://forums.swift.org/categories.md) · [Tags](https://forums.swift.org/tags.md)

---

## [About the Swift Syntax category](https://forums.swift.org/t/about-the-swift-syntax-category/76388)

<div class="topic-metadata">

**Author:** [@mishal\_shah](https://forums.swift.org/u/mishal_shah)\
**Replies:** 0\
**Last updated:** [December 4, 2024, 11:00pm UTC](https://forums.swift.org/t/about-the-swift-syntax-category/76388 "2024-12-04T23:00:44Z")

</div>

For developers to discuss the implementation of the Swift Syntax.

---

## [\[GSoC 2026\] Qualified Name Lookup for swift-syntax](https://forums.swift.org/t/gsoc-2026-qualified-name-lookup-for-swift-syntax/89331)

<div class="topic-metadata">

**Author:** [@filip-sakel](https://forums.swift.org/u/filip-sakel)\
**Replies:** 0\
**Last updated:** [September 1, 2026, 10:04pm UTC](https://forums.swift.org/t/gsoc-2026-qualified-name-lookup-for-swift-syntax/89331 "2026-09-01T22:04:32Z")

</div>

Introduction As part of Google Summer of Code 2026, I implemented a preliminary version of qualified name lookup in swift-syntax under the mentorship of Pavel Yaskevich (@xedin). Building on Jakub Florek’s GSoC 2024 unq…

---

## [Qualified Lookup in SwiftLexicalLookup](https://forums.swift.org/t/qualified-lookup-in-swiftlexicallookup/86875)

<div class="topic-metadata">

**Author:** [@filip-sakel](https://forums.swift.org/u/filip-sakel)\
**Replies:** 11\
**Last updated:** [July 13, 2026, 5:43pm UTC](https://forums.swift.org/t/qualified-lookup-in-swiftlexicallookup/86875 "2026-07-13T17:43:02Z")

</div>

Hi everyone! I’m Filip Sakellariou and I’ll be working on implementing a qualified-lookup query API to SwiftSyntax’s SwiftLexicalLookup module along with my mentor Pavel Yaskevich (@xedin) over the summer as part of GSoC…

---

## [\[RFC\] Allow #warning and #error directives in case position of a switch](https://forums.swift.org/t/rfc-allow-warning-and-error-directives-in-case-position-of-a-switch/87464)

<div class="topic-metadata">

**Author:** [@nenadvulic](https://forums.swift.org/u/nenadvulic)\
**Replies:** 6\
**Last updated:** [June 18, 2026, 12:18pm UTC](https://forums.swift.org/t/rfc-allow-warning-and-error-directives-in-case-position-of-a-switch/87464 "2026-06-18T12:18:20Z")

</div>

Summary #warning and #error directives placed in case position of a switch are currently diagnosed as errors by SwiftSyntax's parser, even though the Swift compiler accepts them. This change makes the parser accept the…

---

## [Error: Target SwiftWarningControl imports another target (SwiftDiagnostics) in the package without declaring it a dependency](https://forums.swift.org/t/error-target-swiftwarningcontrol-imports-another-target-swiftdiagnostics-in-the-package-without-declaring-it-a-dependency/85966)

<div class="topic-metadata">

**Author:** [@taylorswift](https://forums.swift.org/u/taylorswift)\
**Replies:** 1\
**Last updated:** [April 12, 2026, 9:11am UTC](https://forums.swift.org/t/error-target-swiftwarningcontrol-imports-another-target-swiftdiagnostics-in-the-package-without-declaring-it-a-dependency/85966 "2026-04-12T09:11:19Z")

</div>

it almost looks like a prebuilts-linked issue, but in fact, is not. that target really is importing SwiftDiagnostics without an actual dependency edge. this can be seen on Swiftinit, SwiftWarningControl does not include…

---

## [RFC: Add Trivia.docCommentValue property](https://forums.swift.org/t/rfc-add-trivia-doccommentvalue-property/84192)

<div class="topic-metadata">

**Author:** [@PhantomInTheWire](https://forums.swift.org/u/PhantomInTheWire)\
**Replies:** 7\
**Last updated:** [January 19, 2026, 8:50am UTC](https://forums.swift.org/t/rfc-add-trivia-doccommentvalue-property/84192 "2026-01-19T08:50:15Z")

</div>

Hi all, I have a pull request up to introduce Trivia.docCommentValue. This property extracts the text content from documentation comments, removing comment markers (///, /\*\*, \*/) and stripping common indentation. The ge…

---

## [RFC: Multiple modifiers in \`AccessorDeclSyntax\` (for SE-0474)](https://forums.swift.org/t/rfc-multiple-modifiers-in-accessordeclsyntax-for-se-0474/83316)

<div class="topic-metadata">

**Author:** [@tbkka](https://forums.swift.org/u/tbkka)\
**Replies:** 6\
**Last updated:** [December 10, 2025, 11:29am UTC](https://forums.swift.org/t/rfc-multiple-modifiers-in-accessordeclsyntax-for-se-0474/83316 "2025-12-10T11:29:07Z")

</div>

Summary: AccessorDeclSyntax now supports lists of modifiers rather than a single modifier. This is needed to support the new yielding borrow and yielding mutate coroutine accessors added in SE-0474 when used with mod…

---

## [It's the behavior inconsistency caused by any protocol expected?](https://forums.swift.org/t/its-the-behavior-inconsistency-caused-by-any-protocol-expected/83318)

<div class="topic-metadata">

**Author:** [@fililili](https://forums.swift.org/u/fililili)\
**Replies:** 1\
**Last updated:** [November 20, 2025, 5:46am UTC](https://forums.swift.org/t/its-the-behavior-inconsistency-caused-by-any-protocol-expected/83318 "2025-11-20T05:46:46Z")

</div>

With Swift like that: protocol EmptyProtocol { } func printValue\<T\>(\_ value: T) { print("value: \\(value), type: \\(type(of: value))") } struct MyStruct: EmptyProtocol { let name: String } class MyClass: EmptyP…

---

## [Which version of swift syntax should I use with swift tool chain 5.10 and xcode 16.0](https://forums.swift.org/t/which-version-of-swift-syntax-should-i-use-with-swift-tool-chain-5-10-and-xcode-16-0/82638)

<div class="topic-metadata">

**Author:** [@felix91](https://forums.swift.org/u/felix91)\
**Replies:** 2\
**Last updated:** [October 15, 2025, 5:48am UTC](https://forums.swift.org/t/which-version-of-swift-syntax-should-i-use-with-swift-tool-chain-5-10-and-xcode-16-0/82638 "2025-10-15T05:48:26Z")

</div>

Now, I want use swift syntax with my package, my swift package manager version is 5.10, and my xcode is 16.0. Should I use swuft syntax 6.0 or 5.10? In swift syntax, I just find this and Releases of SwiftSyntax are…

---

## [RFC: Static build configuration in SwiftIfConfig and build configurations for macro expansion contexts](https://forums.swift.org/t/rfc-static-build-configuration-in-swiftifconfig-and-build-configurations-for-macro-expansion-contexts/82393)

<div class="topic-metadata">

**Author:** [@Douglas\_Gregor](https://forums.swift.org/u/Douglas_Gregor)\
**Replies:** 16\
**Last updated:** [October 6, 2025, 11:20am UTC](https://forums.swift.org/t/rfc-static-build-configuration-in-swiftifconfig-and-build-configurations-for-macro-expansion-contexts/82393 "2025-10-06T11:20:08Z")

</div>

Hi all, I have a pull request up to introduce StaticBuildConfiguration. This type is a simple, Codable struct that contains enough data to answer any BuildConfiguration-based queries. The general idea is that we'll have…

---

## [Announcing SyntaxKit](https://forums.swift.org/t/announcing-syntaxkit/80560)

<div class="topic-metadata">

**Author:** [@leogdion](https://forums.swift.org/u/leogdion)\
**Replies:** 1\
**Last updated:** [August 12, 2025, 11:23am UTC](https://forums.swift.org/t/announcing-syntaxkit/80560 "2025-08-12T11:23:05Z")

</div>

I love the work the community has done to use DSLs to create convenient ways of expressing ideas. I've done my own work with Swift Packages and have always felt SwiftSyntax could be simplified with a DSL. Unfortunately S…

---

## [RFC: Changing \`ExpandEditorPlaceholdersToLiteralClosures\` & \`CallToTrailingClosures\` to take a \`Syntax\` input](https://forums.swift.org/t/rfc-changing-expandeditorplaceholderstoliteralclosures-calltotrailingclosures-to-take-a-syntax-input/80288)

<div class="topic-metadata">

**Author:** [@hamishknight](https://forums.swift.org/u/hamishknight)\
**Replies:** 2\
**Last updated:** [June 5, 2025, 2:16am UTC](https://forums.swift.org/t/rfc-changing-expandeditorplaceholderstoliteralclosures-calltotrailingclosures-to-take-a-syntax-input/80288 "2025-06-05T02:16:53Z")

</div>

Summary: ExpandEditorPlaceholdersToLiteralClosures & CallToTrailingClosures now take a Syntax parameter and return Syntax? to satisfy the conformance to SyntaxRefactoringProvider. If a non-function-like syntax node is p…

---

## [Trouble mutating a \`SyntaxCollection\`](https://forums.swift.org/t/trouble-mutating-a-syntaxcollection/79559)

<div class="topic-metadata">

**Author:** [@NSExceptional](https://forums.swift.org/u/NSExceptional)\
**Replies:** 1\
**Last updated:** [April 29, 2025, 5:19pm UTC](https://forums.swift.org/t/trouble-mutating-a-syntaxcollection/79559 "2025-04-29T17:19:35Z")

</div>

I'm trying to update and replace a specific MemberBlockItemSyntax within a MemberBlockItemListSyntax. This is proving difficult, as some APIs expect Int indexes, and others vend custom index types that don't expose raw i…

---

## [RFC: Diagnostics formatting for diagnostic messages without relation to source syntax](https://forums.swift.org/t/rfc-diagnostics-formatting-for-diagnostic-messages-without-relation-to-source-syntax/79321)

<div class="topic-metadata">

**Author:** [@Douglas\_Gregor](https://forums.swift.org/u/Douglas_Gregor)\
**Replies:** 1\
**Last updated:** [April 17, 2025, 5:04pm UTC](https://forums.swift.org/t/rfc-diagnostics-formatting-for-diagnostic-messages-without-relation-to-source-syntax/79321 "2025-04-17T17:04:41Z")

</div>

Link to PR: Add a new API DiagnosticsFormatter.formattedMessage(\_:) for messages without source location info by DougGregor · Pull Request #3059 · swiftlang/swift-syntax · GitHub Summary: Some tools want to use the diag…

---

## [RFC: Making the "node" and "position" of Diagnostic and Note optional](https://forums.swift.org/t/rfc-making-the-node-and-position-of-diagnostic-and-note-optional/79045)

<div class="topic-metadata">

**Author:** [@Douglas\_Gregor](https://forums.swift.org/u/Douglas_Gregor)\
**Replies:** 2\
**Last updated:** [April 17, 2025, 12:54am UTC](https://forums.swift.org/t/rfc-making-the-node-and-position-of-diagnostic-and-note-optional/79045 "2025-04-17T00:54:11Z")

</div>

Link to PR: \[Diagnostics\] Make the node and position of Diagnostic and Note optional by DougGregor · Pull Request #3038 · swiftlang/swift-syntax · GitHub Summary: The Diagnostic and Note types require a syntax node …

---

## [RFC: Adding "textual replacement" option to FixIt.Change](https://forums.swift.org/t/rfc-adding-textual-replacement-option-to-fixit-change/78891)

<div class="topic-metadata">

**Author:** [@Douglas\_Gregor](https://forums.swift.org/u/Douglas_Gregor)\
**Replies:** 8\
**Last updated:** [March 29, 2025, 1:56pm UTC](https://forums.swift.org/t/rfc-adding-textual-replacement-option-to-fixit-change/78891 "2025-03-29T13:56:55Z")

</div>

Hi all, Link to PR: Introduce FixIt.Change.textualReplacement by DougGregor · Pull Request #3030 · swiftlang/swift-syntax · GitHub Summary: Fix-It changes are currently expressed in terms of replacing one syntax node w…

---

## [RFC: Remove several special attribute argument list syntax](https://forums.swift.org/t/rfc-remove-several-special-attribute-argument-list-syntax/78889)

<div class="topic-metadata">

**Author:** [@rintaro](https://forums.swift.org/u/rintaro)\
**Replies:** 3\
**Last updated:** [March 28, 2025, 12:45pm UTC](https://forums.swift.org/t/rfc-remove-several-special-attribute-argument-list-syntax/78889 "2025-03-28T12:45:17Z")

</div>

Link to PR: \[Syntax\] Remove unnecessary special attribute arguments syntax kinds by rintaro · Pull Request #3028 · swiftlang/swift-syntax · GitHub Summary: Several builtin attributes that currently has specialized argum…

---

## [RFC: SwiftLexicalLookup](https://forums.swift.org/t/rfc-swiftlexicallookup/77550)

<div class="topic-metadata">

**Author:** [@MAJKFL](https://forums.swift.org/u/MAJKFL)\
**Replies:** 4\
**Last updated:** [March 17, 2025, 8:22pm UTC](https://forums.swift.org/t/rfc-swiftlexicallookup/77550 "2025-03-17T20:22:34Z")

</div>

Description: After working with @Douglas\_Gregor on SwiftLexicalLookup since GSoC 2024, the development of the library has arrived at the point where the API is stable, and it’s possible to run the validation of the curre…

---

## [RFC: Generalize \`expandAttachedMacro\` APIs to accept \`ClosureExprSyntax\`](https://forums.swift.org/t/rfc-generalize-expandattachedmacro-apis-to-accept-closureexprsyntax/78535)

<div class="topic-metadata">

**Author:** [@hborla](https://forums.swift.org/u/hborla)\
**Replies:** 1\
**Last updated:** [March 17, 2025, 5:28pm UTC](https://forums.swift.org/t/rfc-generalize-expandattachedmacro-apis-to-accept-closureexprsyntax/78535 "2025-03-17T17:28:01Z")

</div>

Summary: As part of supporting function body macros on closure expressions, I've added a new requirement to the BodyMacro protocol to accept a value of ClosureExprSyntax, and I generalized the public expandAttachedMacro …

---

## [RFC: Category footnotes in the diagnostics formatter](https://forums.swift.org/t/rfc-category-footnotes-in-the-diagnostics-formatter/78397)

<div class="topic-metadata">

**Author:** [@Douglas\_Gregor](https://forums.swift.org/u/Douglas_Gregor)\
**Replies:** 0\
**Last updated:** [March 9, 2025, 5:10pm UTC](https://forums.swift.org/t/rfc-category-footnotes-in-the-diagnostics-formatter/78397 "2025-03-09T17:10:25Z")

</div>

Hey all, Following up on my previous RFC to add diagnostic categories, I just put up a pull request to print out category name links in the Markdown style, e.g., \[#deprecated\]: \<http://example.com/deprecated\> \[#StrictM…

---

## [RFC: Add category & documentation URL to DiagnosticMessage](https://forums.swift.org/t/rfc-add-category-documentation-url-to-diagnosticmessage/78276)

<div class="topic-metadata">

**Author:** [@Douglas\_Gregor](https://forums.swift.org/u/Douglas_Gregor)\
**Replies:** 2\
**Last updated:** [March 5, 2025, 9:57pm UTC](https://forums.swift.org/t/rfc-add-category-documentation-url-to-diagnosticmessage/78276 "2025-03-05T21:57:40Z")

</div>

This adds an optional category property to DiagnosticMessage, which is used to provide more information about diagnostics. Link to PR: https://github.com/swiftlang/swift-syntax/pull/2981 Swift interface Introduces a ne…

---

## [Unable to build \`swift-syntax\` release from \`swift-6.0-RELEASE\` toolchain?](https://forums.swift.org/t/unable-to-build-swift-syntax-release-from-swift-6-0-release-toolchain/78143)

<div class="topic-metadata">

**Author:** [@vanvoorden](https://forums.swift.org/u/vanvoorden)\
**Replies:** 1\
**Last updated:** [February 27, 2025, 2:01am UTC](https://forums.swift.org/t/unable-to-build-swift-syntax-release-from-swift-6-0-release-toolchain/78143 "2025-02-27T02:01:30Z")

</div>

Is anyone able to build the 600.0.1 release of swift-syntax from command-line using the swift-6.0-RELEASE toolchain? I'm seeing my builds crash… but building from Xcode 16 seems to work ok: $ xcode-select --print-path /…

---

## [RFC: Make \`DiagnosticSeverity\` conform to \`Equatable\`](https://forums.swift.org/t/rfc-make-diagnosticseverity-conform-to-equatable/77867)

<div class="topic-metadata">

**Author:** [@ahoppen](https://forums.swift.org/u/ahoppen)\
**Replies:** 18\
**Last updated:** [February 19, 2025, 8:44pm UTC](https://forums.swift.org/t/rfc-make-diagnosticseverity-conform-to-equatable/77867 "2025-02-19T20:44:52Z")

</div>

Summary: Add an Equatable conformance to the DiagnosticSeverity type Link to PR: Link to the pull request that implements the API change. Swift Interface: public enum DiagnosticSeverity: Sendable, Equatable { case er…

---

## [RFC process for public API changes in swift-syntax](https://forums.swift.org/t/rfc-process-for-public-api-changes-in-swift-syntax/76447)

<div class="topic-metadata">

**Author:** [@ahoppen](https://forums.swift.org/u/ahoppen)\
**Replies:** 2\
**Last updated:** [January 9, 2025, 7:57pm UTC](https://forums.swift.org/t/rfc-process-for-public-api-changes-in-swift-syntax/76447 "2025-01-09T19:57:17Z")

</div>

swift-syntax is a widely used library, and any changes to its public API have a significant impact on its users. So far, we have evaluated this impact during PR reviews. While this has worked for us so far, it has the ri…
