Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Document TabExpansion, TabExpansion2, and ArgumentCompleter #747
From @MartinSGill on August 30, 2016 6:25
TabExpansion could be a really nice feature of PowerShell, but it's very difficult to easily expand it. Usually if you want to you end up writing code like this:
This approach is fine for a single module to extend TabExpansion, but you start running into all sorts of issues (like name collisions) when multiple modules start trying to do the same thing.
It would be great if there were a mechanism to register TabExpansion functions. e.g
Register-TabExpansion -Command cmd.exe -ScriptBlock/File
Internally this function would simply be a map between the command (or an alias) and the function which would be called if the command is matched.
Once there is a consistent mechanism for TabExpansion it should be fairly easy for people to write modules to add expansions for various tools (git, rake, npm, etc), making powershell much more useable.
Copied from original issue: PowerShell/PowerShell#2130
From @lzybkr on August 30, 2016 17:4
We need better documentation, but tab completion is pretty extensible right now.
Extensibility was part of the design introduced with
From @MartinSGill on August 31, 2016 6:22
@lzybkr Thanks for pointing out those features, i'd never have realised they were there.
I certainly agree about the documentation part https://technet.microsoft.com/en-us/library/mt631420.aspx looks a bit empty, as indeed does
I think entries about_TabExpansion (and an alias about_AutoComplete) in the help would be good, and Register-ArgumentCompleter also needs some documentation.
From @kilasuit on August 31, 2016 20:8
There were a number of additional v5 (& now v5.1) features that could have done with clearer docs including classes.
Hopefully though with lead up to a "releasable" v6 we will be able to get this aligned and add in docs like these as well.