Skip to content

Commit

Permalink
bugfix: deduplicate references results
Browse files Browse the repository at this point in the history
  • Loading branch information
kasiaMarek committed Feb 14, 2024
1 parent c133c94 commit e65409f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ final class ReferenceProvider(
includeSynthetics: Synthetic => Boolean,
isJava: Boolean,
): Seq[Location] = {
val buf = Seq.newBuilder[Location]
val buf = Set.newBuilder[Location]
def add(range: s.Range): Unit = {
val revised = distance.toRevised(range.startLine, range.startCharacter)
val dirtyLocation = range.toLocation(uri)
Expand Down Expand Up @@ -470,7 +470,7 @@ final class ReferenceProvider(
range <- synthetic.range.toList
} add(range)

buf.result().sortWith(sortByLocationPosition)
buf.result().toSeq.sortWith(sortByLocationPosition)
}

private def sortByLocationPosition(l1: Location, l2: Location): Boolean = {
Expand Down

0 comments on commit e65409f

Please sign in to comment.