CommentLinesVisitor

public final class CommentLinesVisitor : SyntaxVisitor

Visitor to find lines that contain only comments.

  • Lines that contain actual code (not comments).

    Declaration

    Swift

    public private(set) var linesWithCode: Set<Int> { get }
  • Lines that contain only comments (and whitespace).

    Declaration

    Swift

    public var commentOnlyLines: Set<Int> { get }
  • Initializer.

    Declaration

    Swift

    public init(locationConverter: SourceLocationConverter)

    Parameters

    locationConverter

    The location converter to use for mapping positions to line numbers.

  • Compute all comment-only lines in the given file.

    Declaration

    Swift

    public static func commentLines(in file: SwiftLintFile) -> Set<Int>

    Parameters

    file

    The SwiftLint file to analyze.

    Return Value

    A set of line numbers that contain only comments.

  • Declaration

    Swift

    override public func visit(_ token: TokenSyntax) -> SyntaxVisitorContinueKind