mirror of
https://github.com/realm/SwiftLint.git
synced 2026-05-07 20:12:49 +00:00
914fa02e4e
We can also switch back to an exact SwiftSyntax version now with the plugins in a separate repository. In fact, using the plugin, no direct dependency to SwiftSyntax is required whatsoever.
15 lines
520 B
Swift
15 lines
520 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, .argumentLabel,
|
|
.floatLiteral, .stringLiteral, .ifConfigDirective, .attribute, .editorPlaceholder, .regexLiteral:
|
|
return false
|
|
}
|
|
}
|
|
}
|