Repository: detekt/detekt (kotlin)

Issue:
Unused import does not consider rangeUntil usage
## Expected Behavior
Importing `rangeUntil` and using the `..<` operator should not report an issue for the unused import rule.

## Observed Behavior
It does report an issue.

## Steps to Reproduce
```kotlin
package highbeam.api.some

import highbeam.rest.endpoint.RestEndpoint
import highbeam.type.dateRange.ZonedDateTimeRange
import highbeam.type.dateRange.rangeUntil
import java.time.ZonedDateTime
import java.util.UUID

public object SomeApi {
  @RestEndpoint.Method("GET")
  @RestEndpoint.Path("/foo/bar/baz")
  public data class Search(
    @QueryParam val businessGuid: UUID,
    @QueryParam val dateRangeStart: ZonedDateTime,
    @QueryParam val dateRangeEndExclusive: ZonedDateTime,
  ) : RestEndpoint<Nothing>() {
    val dateRange: ZonedDateTimeRange = dateRangeStart..<dateRangeEndExclusive
  }
}
```

## Your Environment
* Version of detekt used: 1.23.6
* Version of Gradle used (if applicable): 8.6

## Other Context
This is not an issue with `rangeTo`.

Pull request description:
Resolves https://github.com/detekt/detekt/issues/7103.

I have also added a test for the `rangeTo` operator, since there was not one.

Patch:
diff --git a/detekt-rules-style/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnusedImport.kt b/detekt-rules-style/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnusedImport.kt
index 486e3994f870..b656d2c516a0 100644
--- a/detekt-rules-style/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnusedImport.kt
+++ b/detekt-rules-style/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnusedImport.kt
@@ -158,8 +158,9 @@ class UnusedImport(config: Config) : Rule(
     companion object {
         private val operatorSet = setOf(
             "unaryPlus", "unaryMinus", "not", "inc", "dec", "plus", "minus", "times", "div",
-            "mod", "rangeTo", "contains", "get", "set", "invoke", "plusAssign", "minusAssign", "timesAssign",
-            "divAssign", "modAssign", "equals", "compareTo", "iterator", "getValue", "setValue", "provideDelegate"
+            "mod", "rangeTo", "rangeUntil", "contains", "get", "set", "invoke",
+            "plusAssign", "minusAssign", "timesAssign", "divAssign", "modAssign",
+            "equals", "compareTo", "iterator", "getValue", "setValue", "provideDelegate"
         )
 
         private val kotlinDocReferencesRegExp = Regex("\\[([^]]+)](?!\\[)")


Test patch:
diff --git a/detekt-rules-style/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnusedImportSpec.kt b/detekt-rules-style/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnusedImportSpec.kt
index b6b13a684aef..31ef2018bce6 100644
--- a/detekt-rules-style/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnusedImportSpec.kt
+++ b/detekt-rules-style/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnusedImportSpec.kt
@@ -32,6 +32,27 @@ class UnusedImportSpec(val env: KotlinCoreEnvironment) {
         assertThat(subject.lintWithContext(env, main, additional)).isEmpty()
     }
 
+    @Test
+    fun `does not report range operators`() {
+        val main = """
+            import java.time.Month
+            import ranges.rangeTo
+            import ranges.rangeUntil
+            
+            fun main() {
+                LocalDate.of(2024, Month.MARCH, 27)..LocalDate.of(2024, Month.MARCH, 27)
+                LocalDate.of(2024, Month.MARCH, 27)..<LocalDate.of(2024, Month.MARCH, 27)
+            }
+        """.trimIndent()
+        val additional = """
+            package ranges
+            
+            operator fun LocalDate.rangeTo(that: LocalDate) = TODO()
+            operator fun LocalDate.rangeUntil(that: LocalDate) = TODO()
+        """.trimIndent()
+        assertThat(subject.lintWithContext(env, main, additional)).isEmpty()
+    }
+
     @Test
     fun `does not report imports in documentation`() {
         val main = """