mirror of
https://github.com/realm/SwiftLint.git
synced 2026-05-07 20:12:49 +00:00
a773c3ec21
* Improve docstrings for `StringView+SwiftSyntax.swift` * Move changelog entry to correct section & reword * Change parameter type from `Int` to `ByteCount` * Move AbsolutePosition / ByteCount conversion to internal API * Only warn once if syntax tree cannot be parsed * Move Syntactic Sugar examples to a dedicated file * Change SyntacticSugarRuleVisitor from SyntaxAnyVisitor to SyntaxVisitor * Add `SugaredType` enum to help with the implement `SyntacticSugarRule`
12 lines
315 B
Swift
12 lines
315 B
Swift
import SourceKittenFramework
|
|
import SwiftSyntax
|
|
|
|
extension ByteCount {
|
|
/// Converts a SwiftSyntax `AbsolutePosition` to a SourceKitten `ByteCount`.
|
|
///
|
|
/// - parameter position: The SwiftSyntax position to convert.
|
|
init(_ position: AbsolutePosition) {
|
|
self.init(position.utf8Offset)
|
|
}
|
|
}
|