Files
SwiftLint/Source/SwiftLintCore/Extensions/SyntaxClassification+isComment.swift
T
2023-09-14 22:49:55 +02:00

15 lines
504 B
Swift

import SwiftIDEUtils
public extension SyntaxClassification {
// True if it is any kind of comment.
var isComment: Bool {
switch self {
case .lineComment, .docLineComment, .blockComment, .docBlockComment:
return true
case .none, .keyword, .identifier, .type, .operator, .dollarIdentifier, .integerLiteral,
.floatLiteral, .stringLiteral, .ifConfigDirective, .attribute, .editorPlaceholder, .regexLiteral:
return false
}
}
}