Skip to content

Commit

Permalink
only suggest domain when locale is already typed
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenkhoo committed Oct 24, 2021
1 parent 03000d7 commit 6e3598b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,7 @@ public function complete(CompletionInput $input, CompletionSuggestions $suggesti
return;
}

if ($input->mustSuggestOptionValuesFor('domain')) {
$locale = $input->getArgument('locale');

if ($input->mustSuggestOptionValuesFor('domain') && $locale = $input->getArgument('locale')) {
$extractedCatalogue = $this->extractMessages($locale, $this->getRootCodePaths($kernel), $input->getOption('prefix'));

$currentCatalogue = $this->loadCurrentMessages($locale, $this->getRootTransPaths());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public function testComplete(array $input, array $expectedSuggestions)
public function provideCompletionSuggestions()
{
yield 'bundle' => [['en', ''], ['BaseBundle']];
yield 'domain' => [['en', '--domain=m'], ['messages']];
yield 'domain with locale' => [['en', '--domain=m'], ['messages']];
yield 'domain without locale' => [['--domain=m'], []];
yield 'format' => [['en', '--format='], ['php', 'xlf', 'po', 'mo', 'yml', 'yaml', 'ts', 'csv', 'ini', 'json', 'res', 'xlf12', 'xlf20']];
yield 'sort' => [['en', '--sort='], ['asc', 'desc']];
}
Expand Down

0 comments on commit 6e3598b

Please sign in to comment.