-
Notifications
You must be signed in to change notification settings - Fork 931
Description
Checklist
- I have verified this is the correct repository for opening this issue.
- I have verified no other issues exist related to my request.
Is Your Feature Request Related To A Problem? Please describe.
Some Tab Expansions, coming from the ChocolateyTabExpansion.ps1 file, can be slow to complete.
Describe The Solution. Why is it needed?
After some discussions with @AdmiringWorm a few ideas were discussed to improve the overall performance of the tab completions. The winnder from those discussions was to cache the information that is needed to in a file to disk, and have the tab completions use this file(s) to populate the completions.
For example, run the choco config list command, and save the information to disk. Then when someone does choco config set --name=<tab>, rather than having to run the choco config list command to allow cycling through that information, the information is already availalbe in a file on disk, making the look up much faster.
This approach could be used for almost all of the tab completions, by capturing the information from:
choco -h- to get all available commandschoco apikey listchoco config listchoco feature listchoco listchoco list --ignore-pinnedchoco pin listchoco rule listchoco source listchoco template list
On top of capturing this information, we could also look to refresh the information when we "know" that something is changing. For example, when some of the following commands are run:
choco source addchoco config setchoco config unsetchoco feature enable- etc
That would be an "easy" way to keep the information up to date, without having to schedule updating of the files, or by some other mechanism.
The only tab expansion that we would not be able to provide any improvement to with this solution would be the information needed when doing choco search. This would be able to be improved once we complete package indexes.
Additional Context
N/A