Files
SwiftLint/Source/SwiftLintFramework/Extensions/ByteCount+SwiftSyntax.swift
T
JP Simard a773c3ec21 Apply minor changes to the syntactic sugar rewrite (#3915)
* 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`
2022-03-24 10:27:05 -04:00

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)
}
}