-
Notifications
You must be signed in to change notification settings - Fork 130
draft of abbreviation expansion tab completion #150
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
draft of abbreviation expansion tab completion #150
Conversation
Excited to see this. It's going to save a lot of keystrokes with Azure PowerShell. I came here to request one other case that is handled. Allow for the verb side of the dash to be either just the capital letters, or the alias of the verb Here's an example:
Using just the capital letters, they would both resolve still:
However, if we could specify the alias of the verb as well, we can easily differentiate:
This is just one example... But there are a decent amount of verbs that compliment each other that have the same capital letters:
Leveraging the verb alias will save the user time here. Like I said, this is in addition to strictly capital letters. Not a replacement. |
Also excited to see this, but wonder if this is enough. Is the intent here to save typing? Or to make command discovery easier? Or both? Right now this seems designed to save typing for users who know command names, but if I'm thinking through the capital letters in camel case I bet I could type the command almost as quickly as I think it through to break it down. And given the sheer volume of commands available, I wonder how much time this will actually save. What about building an index of commands using the "words" (taken from camel case naming), and then in tab completion breaking up a sequence of characters into those words and finding matches, such that |
Great proposal! I believe there is a way to take it even further and accommodate both @tylerl0706 and @KirkMunro suggestions: fuzzy search. It specifically favors the original proposal (capital letters) and also adds the additional flexibility in a general way. There are plenty of implementations on GitHub, but they are mostly in JS. Here is a good article that described the sublime fuzzy search algorithm https://blog.forrestthewoods.com/reverse-engineering-sublime-text-s-fuzzy-match-4cffeed33fdb |
@vors makes an excellent point. Fuzzy search is super common today in a lot of editors - in fact, VSCode supplies fuzzy search for intellisense today (for all languages including PowerShell). |
I started playing around with fuzzy search. I think I lifted the regex approach from sublime. https://github.com/dfinke/PowerShellFuzzySearch |
Initial propose looks as difficult to discover by users. I guess any user expect that it is possible to type a word and then get variants by tab. I think that @KirkMunro 's suggestion is best start. I'd start with it and then wait a feedback for should we also add search by patterns like |
There are a lot of great ideas and it's unclear what would work the best (and perhaps different people have different needs / styles). Can we introduce a string / enum variable |
Currently we can implement this as an experimental feature(s). |
This RFC as it's written is already submitted as a Experimental Feature PR you can try out right now. I like some of the suggestions, but wonder if, as @iSazonov alluded, they would be separate features (which could be used together). |
LGTM |
…viation-Expansion-TabComplete.md
No description provided.