We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ccb69f6 + 24094ef commit f753b75Copy full SHA for f753b75
Sources/SwiftSyntax/RawSyntax.swift
@@ -260,9 +260,10 @@ extension RawSyntax {
260
// We always consider collections 'present' because they can just be empty.
261
return .present
262
}
263
- if isToken && self.rawTokenKind == .eof {
+ if isToken && (self.rawTokenKind == .eof || self.rawTokenKind == .stringSegment) {
264
// The end of file token never has source code associated with it but we
265
// still consider it valid.
266
+ // String segments can be empty if they occur in an empty string literal or in between two interpolation segments.
267
268
269
0 commit comments