You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like magit-todos doesn't re-calculate the scanner it uses based on which hosts its running on. If my local host has ripgrep but my remote does not magit todos fails when it can't find ripgrep.
The text was updated successfully, but these errors were encountered:
Finally, I'm not entirely sure about the name of the option, and maybe the option itself. It might be good to consider if this is the best way to handle the issue.
Objectively I think the sensible solution here would be no option but to check when you try to run a command whether it's available where you're trying to run it. You should ideally always do this. I think maybe removing the caching of the available scanner within magit-todos-scanner would be the best choice here. Leave it customizable as a symbol such as 'ag, 'rg etc. Anywhere we want to use a scanner we just call (magit-todos--choose-scanner) directly. If the user has manually selected a scanner which isn't available log a warning and skip (otherwise always search for the best one).
I think the performance optimisation of repeated executable-find calls is practically negligable and this would be the most robust solution going forward (for remote files executable-find is cached regardless, and on localhost it's so quick I don't see the harm).
For example, since a remote system might not have the same scanners installed, it might be good to address that problem in a unified way, e.g. testing for the scanner's presence and falling back to git diff, or disabling remote scanning entirely, etc.
I agree. I'd say always check for what's there. Maybe refactor the magit-todos-scanner option so it can be:
A function (for legacy purposes).
A symbol (for a defined scanner).
A list of symbols (so users can set scanner preferences).
I don't plan to work on this myself anytime soon, so patches welcome.
alphapapa
changed the title
Scanner doesn't check for scanner on remotes
Refactor scanner selection to check for availabilty (especially on remote systems)
May 12, 2024
Hi,
Looks like magit-todos doesn't re-calculate the scanner it uses based on which hosts its running on. If my local host has ripgrep but my remote does not magit todos fails when it can't find ripgrep.
The text was updated successfully, but these errors were encountered: