private function getUnqualifiedCompletions(
        string $prefix,
        string $currentNamespace,
        array $importTables,
        bool $requireCanBeInstantiated
    ): \Generator {
        // Aliases
        list($namespaceAliases,,) = $importTables;
        // use Foo\Bar
        yield from $this->getCompletionsForAliases(
            $prefix,
            $namespaceAliases,
            $requireCanBeInstantiated
        );

        // Completions from the current namespace
        yield from $this->getCompletionsForFqnPrefix(
            nameConcat($currentNamespace, $prefix),
            $requireCanBeInstantiated,
            false
        );

        if ($currentNamespace !== '' && $prefix === '') {
            // Get additional suggestions from the global namespace.
            // When completing e.g. for new |, suggest \DateTime
            yield from $this->getCompletionsForFqnPrefix('', $requireCanBeInstantiated, true);
        }

        if (!$requireCanBeInstantiated) {
            if ($currentNamespace !== '' && $prefix !== '') {
                // Roamed definitions (i.e. global constants and functions). The prefix is checked against '', since
                // in that case global completions have already been provided (including non-roamed definitions.)
                yield from $this->getRoamedCompletions($prefix);
            }

            // Lastly and least importantly, suggest keywords.
            yield from $this->getCompletionsForKeywords($prefix);
        }
    }