swift-syntax
swift-syntax copied to clipboard
A set of Swift libraries for parsing, inspecting, generating, and transforming Swift source code.
### Description Before migrating to use "swift-testing", one of my package's average CI time is as the following XCTest macOS 13 + Swift 5.9.2 Ubuntu + Swift 5.9.2 Swift Test(Debug+Covage)...
This PR changes the signature of `assertMacroExpansion()` such that an alternative failure handler can be passed for use when e.g. swift-testing is being used. Right now, the function calls `XCTAssertEqual()`,...
### Description Test targets that use swift-testing instead of XCTest need some way to work with this function; let's add a throwing equivalent that can be used without any dependency...
When applying an attached member macro to e.g. a variable, `assertMacroExpansion` will currently happily swallow the attribute. It should, however, emit an error that member macros can’t be applied to...
### Issue Kind Bad Diagnostic Produced ### Source Code ```swift test { ([X]) in } ``` ### Description New parser: ``` error: unexpected code '[X]' in parameter clause test {...
On any syntax tree, you can call `.tracked`. Any tree that is derived from that tracked tree is able to find the original syntax node in the tracked tree. Use...
### Description I've been tinkering with macro expansions in Swift and hit an interesting crossroad. It's all about how we handle the order of `DiagnosticSpec` in `assertMacroExpansion`. I'm curious to...
* Introduce `ParsingOptions` option-set type with `bodySkipping` member, and add `options: ParsingOptions` to all `Parser.parse(...)` functions * Skipped body is represented as a newly introduced `SkippedDeclSyntax` * `SkippedDeclSyntax` contains only...
### Description - [x] Add unit tests @Matejkob #2163 - [ ] Make implementations of all macros consistent - [x] Change nodes modification to use variable setters instead of `with`...
`LibraryPluginProvider` is a `PluginProvider` that can load shared library plugins at runtime. --- in the near future, combined with https://github.com/apple/swift-syntax/pull/2301, in `ASTGen`, we can easily create in-process "plugin server" like...