1
0
Fork 0

Find references on unused symbol must not load referenced URIs

pull/392/head
Stephan Unverwerth 2017-06-09 20:48:50 +02:00
parent f10680e441
commit 258b905d9f
1 changed files with 12 additions and 9 deletions

View File

@ -221,15 +221,18 @@ class TextDocument
return [];
}
}
$refDocuments = yield Promise\all(array_map(
[$this->documentLoader, 'getOrLoad'],
$this->index->getReferenceUris($fqn)
));
foreach ($refDocuments as $document) {
$refs = $document->getReferenceNodesByFqn($fqn);
if ($refs !== null) {
foreach ($refs as $ref) {
$locations[] = Location::fromNode($ref);
$referenceUris = $this->index->getReferenceUris($fqn);
if (!empty($referenceUris)) {
$refDocuments = yield Promise\all(array_map(
[$this->documentLoader, 'getOrLoad'],
$referenceUris
));
foreach ($refDocuments as $document) {
$refs = $document->getReferenceNodesByFqn($fqn);
if ($refs !== null) {
foreach ($refs as $ref) {
$locations[] = Location::fromNode($ref);
}
}
}
}