private function getCompletionsForFqnPrefix(
        string $prefix,
        bool $requireCanBeInstantiated,
        bool $insertFullyQualified
    ): \Generator {
        $namespace = nameGetParent($prefix);
        foreach ($this->index->getChildDefinitionsForFqn($namespace) as $fqn => $def) {
            if ($requireCanBeInstantiated && !$def->canBeInstantiated) {
                continue;
            }
            if (!nameStartsWith($fqn, $prefix)) {
                continue;
            }
            $completion = CompletionItemFactory::fromDefinition($def);
            if ($insertFullyQualified) {
                $completion->insertText =  '\\' . $fqn;
            }
            yield $fqn => $completion;
        }
    }