cider icon indicating copy to clipboard operation
cider copied to clipboard

Add a visual progress for when evaluating a directory recursively

Open J0sueTM opened this issue 1 year ago • 6 comments

Recently, since I'm working with a big clj project, I periodically use cider-eval-all-files, and it works fine. The only problem is that I always underestimate the time it takes to compile all the files in a directory, and endup evaluating another directory while the first one is still in progress.

That's what I try to solve with this PR. By adding a visual progress, it becomes easier to know if its OK to continue evaluating other modules of my code that depends on the thing that's currently being done.

BTW, I ran eldev lint, and some errors showed up, but none of them had to do with my changes.


Before submitting the PR make sure the following things have been done (and denote this by checking the relevant checkboxes):

  • [X] The commits are consistent with our contribution guidelines
  • [X] You've added tests (if possible) to cover your change(s)
  • [X] All tests are passing (eldev test)
  • [X] All code passes the linter (eldev lint) which is based on elisp-lint and includes
  • [X] You've updated the changelog (if adding/changing user-visible functionality)
  • [X] You've updated the user manual (if adding/changing user-visible functionality)

Thanks!

If you're just starting out to hack on CIDER you might find this section of its manual extremely useful.

J0sueTM avatar Jan 31 '24 12:01 J0sueTM

@J0sueTM ping :-)

bbatsov avatar Feb 28 '24 08:02 bbatsov

Thanks for pinging @bbatsov completely forgot about it! My time hasn't been the most generous recently :sweat_smile: . I'll be coming with changes in the coming days.

J0sueTM avatar Feb 28 '24 12:02 J0sueTM

Btw, I still don't like that we're now passing some text around. Might be better to make the message optional or move the progress reporting to the function that deals with many namespaces or to rename the progress param to something like msg, so it's clearer what this is.

Also - for a lot of files some status bar might be a better option (e.g. https://www.gnu.org/software/emacs/manual/html_node/elisp/Progress.html or spinner.el that we're using elsewhere in the code)

bbatsov avatar Mar 03 '24 06:03 bbatsov

@J0sueTM ping :-)

bbatsov avatar May 07 '24 12:05 bbatsov

hey @bbatsov. I'm probably not able to finish this PR in the way you guys want. Nothing wrong with that, of course, I just don't know much about ELisp or have enough time in order to accomodate your quality requests :sweat_smile:.

I'm sorry for taking your time. Could you please either close the PR or backlog it so, if on interest of anyone, implement this better later?

Thanks for the great lib. I use it daily and it work flawlessly!

J0sueTM avatar May 07 '24 12:05 J0sueTM

It's no issue. Normally in these cases someone from us can pick up the branch and do whatever's needed, preserving attribution to you.

(Will do)

vemv avatar May 07 '24 12:05 vemv

@katomuso That's a fairly small and simple task, that might be interesting to you if you're looking for more tickets to tackle.

bbatsov avatar Jun 10 '24 04:06 bbatsov

@katomuso That's a fairly small and simple task, that might be interesting to you if you're looking for more tickets to tackle.

I will look into it sometime this month. Do I need to create a separate PR and link to this one, or is there a better way to do this?

katomuso avatar Jun 10 '24 05:06 katomuso

@katomuso You can just do a separate PR - as noted in my comments, I think it's much better (and simpler) to just use a real progress indicator (either a built-in one or coming from spinner.el, which is a CIDER dep) instead of indicating progress via a message printed in the minibuffer.

bbatsov avatar Jun 10 '24 05:06 bbatsov

@katomuso You can just do a separate PR - as noted in my comments, I think it's much better (and simpler) to just use a real progress indicator (either a built-in one or coming from spinner.el, which is a CIDER dep) instead of indicating progress via a message printed in the minibuffer.

As far as I understand, spinner.el can't show exact progress (number of evaluated files / number of total files). I will look into the ways in which this is possible, as it is not very reassuring to wait a minute or two without knowing how much longer it will take.

katomuso avatar Jun 10 '24 05:06 katomuso

That's the classic built-in approach - https://www.gnu.org/software/emacs/manual/html_node/elisp/Progress.html I mentioned spinner just because some indication that something is happening will still be an improvement over no indication. :-)

bbatsov avatar Jun 10 '24 05:06 bbatsov