Add nu-complete cache helper#931
Conversation
|
This sounds cool to me. Here's my two cents.
I think i'd start out with in-mem and later add a file db option if people ask for it.
With in-mem it's pretty easy. When you exit nushell, it's gone. Or, you can do
That's tricky. You may have to try a few things to find out what works best.
If you try to execute it without args it may create an error. You could also maybe look at the view source output. There's not an introspection way to determine this, that I know of.
I'd make it a parameter with a default location. |
I wanted to propose a solution to issues with very slow command completions (as mentioned in nushell/nushell#11733 and #588) with a command that caches closure outputs in a SQLite db with an explicit expiration.
Usage
This can be used in custom completion functions to temporarily cache the output.
Open points
view sourceon the closure as a key into this cache?This is very much a WIP, if you have any suggestions please mention it!