nunomaduro / termwind

🍃 In short, it's like Tailwind CSS, but for the PHP command-line applications.
MIT License
2.29k stars 78 forks source link

[feat] autocomplete for questions #153

Closed fabio-ivona closed 1 year ago

fabio-ivona commented 2 years ago

This PR will add autocomplete feature for ask/Question

here's the resulting prompt:

https://user-images.githubusercontent.com/8792274/188404964-8d521a32-3a3d-4a7d-8e54-2e99d5c886da.mp4

fabio-ivona commented 2 years ago

Will check in a while the failing test

fabio-ivona commented 2 years ago

@xiCO2k would you mind to try executing tests in your local environment? I don't see them fail on my machine, I'm wondering if it is a workflows environment issue

xiCO2k commented 2 years ago

All passing local as well.

fabio-ivona commented 2 years ago

That's weird, maybe this fails in workflows because it detects there's not interactive terminal?

xiCO2k commented 2 years ago

Definately possible, we may need to check on Symfony Console source how they test that stuff.

fabio-ivona commented 2 years ago

Definately possible, we may need to check on Symfony Console source how they test that stuff.

They gave up too :rofl:

image

I updated the test adding a skip if stty is not available and added a test to ensure autocomplete values are set in Symfony Question

xiCO2k commented 2 years ago

ping @nunomaduro

roberto910907 commented 1 year ago

@nunomaduro can we merge this PR, please?

fabio-ivona commented 1 year ago

@xiCO2k I updated the code merging from #156

I guess that switching from

 return $output->ask($html);

to

 return $output->askQuestion($question);

should solve the conflict, but it would be great if you could have a look at it too

fabio-ivona commented 1 year ago

@xiCO2k I updated the code merging from https://github.com/nunomaduro/termwind/pull/156

I guess that switching from

return $output->ask($html); to

return $output->askQuestion($question); should solve the conflict, but it would be great if you could have a look at it too

xiCO2k commented 1 year ago

Will check @fabio-ivona

fabio-ivona commented 1 year ago

@xiCO2k phpstan errors fixed in #158

xiCO2k commented 1 year ago

Thanks

xiCO2k commented 1 year ago

Looks good to me, @nunomaduro thoughts?