Files
SwiftLint/Source/SwiftLintCore/Extensions/SyntaxClassification+isComment.swift
T
JP Simard 6b094dd711 [SwiftSyntax] Update to latest 509.0.0 tag (#4920)
* [bazel] Remove custom SwiftSyntax BUILD file

Something similar to this has been merged upstream instead now. This
also renames the repo name to SwiftSyntax in preparation for it being in
the BCR

* [SwiftSyntax] Update to latest 509.0.0 tag

https://github.com/apple/swift-syntax/releases/tag/509.0.0-swift-DEVELOPMENT-SNAPSHOT-2023-04-25-b
2023-05-03 11:34:26 -04:00

16 lines
604 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, .typeIdentifier, .operatorIdentifier, .dollarIdentifier, .integerLiteral,
.floatingLiteral, .stringLiteral, .stringInterpolationAnchor, .poundDirectiveKeyword, .buildConfigId,
.attribute, .objectLiteral, .editorPlaceholder, .regexLiteral:
return false
}
}
}