Skip to content

Commit

Permalink
Merge pull request #762 from ahoppen/fix-build-issue
Browse files Browse the repository at this point in the history
Fix a build issue in swift-format
  • Loading branch information
ahoppen authored Jun 27, 2024
2 parents d11bc2a + ac7ab23 commit 4b62459
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Sources/SwiftFormat/API/Selection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ public enum Selection {
}
}

extension Range<AbsolutePosition> {
// Returns `true` if the intersection between this range and `other` is non-empty or if the two ranges are directly
/// adjacent to each other.
public func overlapsOrTouches(_ other: Range<AbsolutePosition>) -> Bool {
return self.upperBound >= other.lowerBound && self.lowerBound <= other.upperBound
}
}


public extension Syntax {
/// - Returns: `true` if the node is _completely_ inside any range in the selection
Expand Down

0 comments on commit 4b62459

Please sign in to comment.