Skip to content

Commit d912f36

Browse files
committed
Re-add Syntax.withoutTrivia()
Even though I'm not sure how this can be used considering it's `internal` and SwiftSyntax still compiles without it, but CI is clearly failing when it's not there. ``` Undefined symbols for architecture x86_64: "(extension in SwiftSyntax):SwiftSyntax.SyntaxProtocol.withoutTrivia() -> A", referenced from: swiftASTGen.evaluateMacro(sourceFilePtr: Swift.UnsafePointer<Swift.UInt8>, sourceLocationPtr: Swift.UnsafePointer<Swift.UInt8>?, expandedSourcePointer: Swift.UnsafeMutablePointer<Swift.UnsafePointer<Swift.UInt8>?>, expandedSourceLength: Swift.UnsafeMutablePointer<Swift.Int>) -> Swift.Int in Macros.swift.o ld: symbol(s) not found for architecture x86_64 ```
1 parent 11aec5d commit d912f36

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sources/SwiftSyntax/Syntax.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,11 @@ public extension SyntaxProtocol {
472472
return withTrailingTrivia([])
473473
}
474474

475+
/// Returns a new syntax node with all trivia removed.
476+
func withoutTrivia() -> Self {
477+
return withoutLeadingTrivia().withoutTrailingTrivia()
478+
}
479+
475480
/// The length of this node including all of its trivia.
476481
var totalLength: SourceLength {
477482
return raw.totalLength

0 commit comments

Comments
 (0)