diff --git a/src/Server/TextDocument.php b/src/Server/TextDocument.php index d6d7df5..78536a3 100644 --- a/src/Server/TextDocument.php +++ b/src/Server/TextDocument.php @@ -227,6 +227,10 @@ class TextDocument } else { // Definition with a global FQN $fqn = DefinitionResolver::getDefinedFqn($node); + // Wait until indexing finished + if (!$this->index->isComplete()) { + yield waitForEvent($this->index, 'complete'); + } if ($fqn === null) { $fqn = $this->definitionResolver->resolveReferenceNodeToFqn($node); if ($fqn === null) {