Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocomplete: Tab behavior #9

Open
vicb opened this issue Feb 10, 2013 · 7 comments
Open

Autocomplete: Tab behavior #9

vicb opened this issue Feb 10, 2013 · 7 comments
Labels

Comments

@vicb
Copy link
Contributor

vicb commented Feb 10, 2013

It would be great that tab stops after the first ":" where different commands are possible.

IE after "doct", tab should stop on "doctrine:"

@laszlokorte
Copy link
Member

This is how I implemented it in a really early version but I did not like it because there is already a command selected in the suggestion list so when you press tab I would assume this selected command is used.

When I type "doc" and the first suggestion is "doctrine:cache:clear-metadata" and it is selected (given the behavior you suggest is implemented) I would need to press tab 3 times.

One possibility would be not to focus a suggestion by default and only use your suggested behavior when no suggestion is selected but I assume that would not be very intuitive because there would be more different cases of behavior.

Do you have a concrete case in mind in which the behavior you suggest would be easier to use?
I mean when typing "doc" you already see all the doctrine commands.
I assume it is about this case:

you want to use the "doctrine:cache:clear-result" command and want to type:
"doc"[tab]"ca"[tab]"clear-result"
so you save the time writing "trine" and "che".

But the much easier way would be to just write "clear-result" in the beginning as the autocompletion does not force you to start on the left side of the command.

@vicb
Copy link
Contributor Author

vicb commented Feb 10, 2013

"doctrine:generate:entities" could be a good example. If I wan to use this comand, I would like to be able to type:

  • "doc"
  • tab
  • "ge"
  • tab
  • "ent"
  • tab

One possibility would be not to focus a suggestion by default and only use your suggested behavior when no suggestion is selected but I assume that would not be very intuitive because there would be more different cases of behavior.

👍 for this. I assume that you would rarely use the first command anyway (especially true when you have a lot of commands, like in the "doctrine" ns).

I think the most "difficult" part of the PR it to avoid unambiguous stops:

  • "namespace:sub:abc"
  • "namespace:sub:def"

"nam" + tab should autocomplete to "namespace:sub:" as this is not ambiguous.

@laszlokorte
Copy link
Member

What should happen wenn I type:
"c"
tab

I could autocompelete to "cache:" or "config:" or "container:"

Currently the autocompletion list also shows all the doCtrine commands as suggestion too.

@vicb
Copy link
Contributor Author

vicb commented Feb 10, 2013

Ideally I think you should stop autocompleting where the completion becomes ambiguous (multiple solutions). This would match the behavior of terminals. To continue either select a (sub)command or type more letters.

That's would be the best thing to have imo but something different would be ok if this makes the code too complicated.

Laszlo Korte [email protected] wrote:

What should happen wenn I type:
"c"
tab

I could autocompelete to "cache:" or "config:" or "container:"

Currently the autocompletion list also shows all the doCtrine commands
as suggestion too.


Reply to this email directly or view it on GitHub:
#9 (comment)

@laszlokorte
Copy link
Member

Ok...

I have started implementing this a separate branch:
https://github.com/CoreSphere/ConsoleBundle/tree/alternate-autocomp

When the input is ambiguous the old behavior is used:
focus first item in autocompletion list

When the input is the prefix of exactly one namespace:
no suggestion is focused and pressing tab triggers the autocompletion up to the next ":"

@vicb
Copy link
Contributor Author

vicb commented Feb 10, 2013

I won't have time to look at it before next friday.

On 02/10/2013 09:37 PM, Laszlo Korte wrote:

Ok...

I have started implementing this a separate branch:
https://github.com/CoreSphere/ConsoleBundle/tree/alternate-autocomp

When the input is ambiguous the old behavior is used:
focus first item in autocompletion list

When the input is the prefix of exactly one namespace:
no suggestion is focused and pressing tab triggers the autocompletion
up to the next ":"


Reply to this email directly or view it on GitHub
#9 (comment)..

@TomasVotruba
Copy link
Contributor

Is this still active? If not, I'd suggesting closing.

In case of interest, PR is welcomed of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants