parent
b8a113ddd0
commit
96ea8608d7
|
@ -208,9 +208,12 @@ class TextDocument
|
|||
} else {
|
||||
// Definition with a global FQN
|
||||
$fqn = DefinitionResolver::getDefinedFqn($node);
|
||||
if ($fqn === null) {
|
||||
$fqn = $this->definitionResolver->resolveReferenceNodeToFqn($node);
|
||||
if ($fqn === null) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
$refDocuments = yield Promise\all(array_map(
|
||||
[$this->documentLoader, 'getOrLoad'],
|
||||
$this->index->getReferenceUris($fqn)
|
||||
|
|
|
@ -146,4 +146,17 @@ class GlobalTest extends ServerTestCase
|
|||
new Location($referencesUri, new Range(new Position(31, 13), new Position(31, 40)))
|
||||
], $result);
|
||||
}
|
||||
|
||||
public function testReferencesForReference()
|
||||
{
|
||||
// $obj = new TestClass();
|
||||
// Get references for TestClass
|
||||
$reference = $this->getReferenceLocations('TestClass')[0];
|
||||
$result = $this->textDocument->references(
|
||||
new ReferenceContext,
|
||||
new TextDocumentIdentifier($reference->uri),
|
||||
$reference->range->start
|
||||
)->wait();
|
||||
$this->assertEquals($this->getReferenceLocations('TestClass'), $result);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue