autocomplete
autocomplete copied to clipboard
[cd] recursive/deep suggestions
Sanity checks
- [X] My issue relates to a specific CLI completion spec (e.g.
git checkoutis missing options ingitcompletion spec). If your issue is more general, please create your issue here: withfig/fig - [X] I have searched github.com/withfig/autocomplete/issues and there are no duplicates of my issue
- [ ] I would like to work on this.
What CLI tool does this relate to?
cd
Which statement makes the most sense?
Something else
Issue Details
It would be good for cd to search deeply.
.
|- a
| |- src
|- b
|- src
Typing cd src could suggest a/src and b/src, generating { displayName: "a/src", name: "src" } etc.
I don't think it would be necessary to show both in the list immediately.
Perhaps this should be enabled only if the typed token doesn't match any other suggestions or if autocomplete.fuzzySearch is true.
Actually just thinking about this more - cd */ should show both suggestions too (currently just shows src). If the full path of the item doesn't end with the last token, that's a good sign a glob was used and the displayName should be the relative path instead of the file name.
Setup:
mkdir -p fig-testing/{a,b}/src
cd fig-testing
# now observe the suggestions for this command:
cd */