history = $history; } /** * {@inheritdoc} */ public function appliesToKind(int $kinds): bool { return ($kinds & CompletionKind::COMMAND) !== 0; } /** * {@inheritdoc} */ public function getCompletions(AnalysisResult $analysis): array { if ($analysis->prefix === '') { return []; } // Newest first, deduplicated $commands = $this->history->search('', false); return \array_values(\array_unique($commands)); } }