Skip to content

Commit 62d8f9f

Browse files
authored
Merge pull request #2383 from rintaro/syntaxtext-spi
`TokenSyntax.rawText` to get raw token text as `SyntaxText`
2 parents 60791cd + 81d61ee commit 62d8f9f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sources/SwiftSyntax/TokenSyntax.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ public struct TokenSyntax: SyntaxProtocol, SyntaxHashable {
7575
return tokenKind.text
7676
}
7777

78+
@_spi(RawSyntax)
79+
public var rawText: SyntaxText {
80+
return tokenView.rawText
81+
}
82+
7883
/// The leading trivia (spaces, newlines, etc.) associated with this token.
7984
public var leadingTrivia: Trivia {
8085
get {

0 commit comments

Comments
 (0)