Skip to content
This repository was archived by the owner on Mar 6, 2022. It is now read-only.

Commit dad6447

Browse files
committed
make the test pass
1 parent 58478eb commit dad6447

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

lib/LanguageServerReferenceFinder/Handler/ReferencesHandler.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,18 @@ public function references(
161161
*/
162162
private function toLocations(array $locations): array
163163
{
164-
return $this->locationConverter->toLspLocations(new Locations($locations));
164+
usort($locations, function (Location $first, Location $second) {
165+
$order = strcmp((string) $first->uri(), (string) $second->uri());
166+
if (0 !== $order) {
167+
return $order;
168+
}
169+
170+
return $first->offset()->toInt() - $second->offset()->toInt();
171+
});
172+
173+
$lspLocations = $this->locationConverter->toLspLocations(new Locations($locations));
174+
175+
return $lspLocations;
165176
}
166177

167178
public function registerCapabiltiies(ServerCapabilities $capabilities): void

0 commit comments

Comments
 (0)