MultilineStringLiteralVisitor
public final class MultilineStringLiteralVisitor : SyntaxVisitor
Visitor to collect line numbers that are covered by multiline string literals.
This visitor traverses the syntax tree to identify multiline string literals (those using triple quotes """
)
and collects all line numbers that fall within their boundaries. This is useful for rules that need to
apply different behavior to content inside multiline string literals.
-
Line numbers that are covered by multiline string literals.
Declaration
Swift
public private(set) var linesSpanned: Set<Int> { get }
-
Initializer.
Declaration
Swift
public init(locationConverter: SourceLocationConverter)
Parameters
locationConverter
The location converter to use for mapping positions to line numbers.
-
Visits string literal expressions and collects line numbers for multiline string literals.
Only processes string literals that use triple quotes (
"""
) and span multiple lines. Single-line string literals are ignored.Declaration
Swift
override public func visitPost(_ node: StringLiteralExprSyntax)
Parameters
node
The string literal expression to examine.