parent
b8a113ddd0
commit
96ea8608d7
|
@ -209,7 +209,10 @@ class TextDocument
|
||||||
// Definition with a global FQN
|
// Definition with a global FQN
|
||||||
$fqn = DefinitionResolver::getDefinedFqn($node);
|
$fqn = DefinitionResolver::getDefinedFqn($node);
|
||||||
if ($fqn === null) {
|
if ($fqn === null) {
|
||||||
return [];
|
$fqn = $this->definitionResolver->resolveReferenceNodeToFqn($node);
|
||||||
|
if ($fqn === null) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$refDocuments = yield Promise\all(array_map(
|
$refDocuments = yield Promise\all(array_map(
|
||||||
[$this->documentLoader, 'getOrLoad'],
|
[$this->documentLoader, 'getOrLoad'],
|
||||||
|
|
|
@ -146,4 +146,17 @@ class GlobalTest extends ServerTestCase
|
||||||
new Location($referencesUri, new Range(new Position(31, 13), new Position(31, 40)))
|
new Location($referencesUri, new Range(new Position(31, 13), new Position(31, 40)))
|
||||||
], $result);
|
], $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