murex icon indicating copy to clipboard operation
murex copied to clipboard

Recursive directory lookup enhancements

Open lmorg opened this issue 5 years ago • 2 comments

A few ideas to improve the recursive directory lookups in murex:

  • [ ] exclusion paths
  • [ ] pre-fetch cache
  • [x] delayed autocompletion suggestions

Exclusion paths

It might be known before hand that some paths will return slower results (eg when reading from uncached mechanical drives, or when reading from /).

This should be exposed via config

Pre-fetch cache

Maybe do a pre-fetch based on pwd. However this would need to configurable via config and honour any exclusion paths (above) too.

Delayed autocompletion suggestions

This would require another hack to readline:

  1. To support delayed suggestions ala delayed syntax highlights with spellcheck
  2. To crop the delayed suggestion to fit the existing suggestions tab box (in this instance I suggest including the first and last portions of the text with the unicode equivalent of ... character)

lmorg avatar Oct 03 '19 08:10 lmorg

Delayed autocompletion has been implemented and pushed to the recursive-directory-enhancements branch (commit: ff34783). There are a few things to bare in mind:

  1. This pushes the murex branch of readline further out of sync with the master branch. At this point in time, it's not safe to delete the vendors directory and repopulate.

  2. The existing config option for recursive-timeout doesn't really make much sense any longer. So it's been removed and replaced with two new options: recursive-soft-timeout and recursive-hard-timeout. The former is how long to wait before anything is displayed and the latter is how long to wait before the recursive lookup is killed entirely (and the progress so far is appended)

  3. There isn't any unit tests for this change. It's going to be quite a hard thing to write tests for too

The expectation is this will be merged into develop soon (possibly even today) however I don't expect it to hit master for Sunday nights/Monday mornings build pipeline as I'd prefer a little more beta testing first

lmorg avatar Oct 05 '19 09:10 lmorg

re exclusion paths, currently murex just uses filesystem.Walk because it was the fastest (in terms of development time) way to implement that feature. However it might make more sense to rewrite that where I can descend each directory one level at a time across the mapped tree (instead of descending down one branch at a time). This means partial searches will be more useful. I can then also incorporate exclusion paths too.

lmorg avatar Oct 05 '19 09:10 lmorg