termwind icon indicating copy to clipboard operation
termwind copied to clipboard

[feat] autocomplete for questions

Open fabio-ivona opened this issue 2 years ago • 7 comments

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 avatar Sep 05 '22 08:09 fabio-ivona

Will check in a while the failing test

fabio-ivona avatar Sep 05 '22 11:09 fabio-ivona

@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

fabio-ivona avatar Sep 05 '22 12:09 fabio-ivona

All passing local as well.

xiCO2k avatar Sep 05 '22 14:09 xiCO2k

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

fabio-ivona avatar Sep 05 '22 14:09 fabio-ivona

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

xiCO2k avatar Sep 06 '22 10:09 xiCO2k

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

fabio-ivona avatar Sep 06 '22 19:09 fabio-ivona

ping @nunomaduro

xiCO2k avatar Sep 09 '22 15:09 xiCO2k

@nunomaduro can we merge this PR, please?

roberto910907 avatar Nov 27 '22 00:11 roberto910907

@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 avatar Nov 30 '22 08:11 fabio-ivona

@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

fabio-ivona avatar Nov 30 '22 08:11 fabio-ivona

Will check @fabio-ivona

xiCO2k avatar Nov 30 '22 11:11 xiCO2k

@xiCO2k phpstan errors fixed in #158

fabio-ivona avatar Nov 30 '22 13:11 fabio-ivona

Thanks

xiCO2k avatar Nov 30 '22 14:11 xiCO2k

Looks good to me, @nunomaduro thoughts?

xiCO2k avatar Nov 30 '22 14:11 xiCO2k