Silver Searcher is a bit of out of active maintenance recently, it's regretful, and I'm recently trouble a lot by that "ag" doesn't recognize the negated rules in gitignore, so it caused some weird behaviors in a repo like this one. It's a regret, I've been using helm-ag for a long while, thanks for the great efforts of the contributors, this tool benefits me a lot, especially for its robust command line option support and async helm source support (helm-do-ag). I noticed for a while that, helm-ag does attempt to support other searcher, including "pt", "ack" and "rg". However, I don't know why, the support just stops at replacing default base command with helm-ag-base-command custom variable, it doesn't really support the option syntax difference between searchers.
As "rg" now is the most popular searcher, it outweights others in performance, and it is under active development. To me, the good news is it supports gitignore well. After some painful tries on other emacs packages, like "rg", pure "helm grep" with rg backend etc..., it's hard to find a good balance between "helm", "rg" and "project search". So, I finally tried to harden helm-ag to support "rg" better. Hope this effort can make slight sense.
The changes I made in this PR includes:
when you set helm-ag-base-command with a rg command, like "rg --no-heading", helm-ag now:
supports ".rgignore"
supports recognize helm-ag-ignore-patterns, and convert them into rg compatible format.
some maintenance changes:
replaced deprecated helm-attr and helm-attrset with 'helm-get-attrandhelm-set-attr`.
merged and normalized helm-ag--construct-command and helm-ag--construct-do-ag-command, they do same thing basically in different formats, very confusing. Now, consolidated under helm-ag--construct-command.
What are changes in this PR
Silver Searcher is a bit of out of active maintenance recently, it's regretful, and I'm recently trouble a lot by that "ag" doesn't recognize the negated rules in gitignore, so it caused some weird behaviors in a repo like this one. It's a regret, I've been using helm-ag for a long while, thanks for the great efforts of the contributors, this tool benefits me a lot, especially for its robust command line option support and async helm source support (helm-do-ag). I noticed for a while that, helm-ag does attempt to support other searcher, including "pt", "ack" and "rg". However, I don't know why, the support just stops at replacing default base command with
helm-ag-base-command
custom variable, it doesn't really support the option syntax difference between searchers.As "rg" now is the most popular searcher, it outweights others in performance, and it is under active development. To me, the good news is it supports gitignore well. After some painful tries on other emacs packages, like "rg", pure "helm grep" with rg backend etc..., it's hard to find a good balance between "helm", "rg" and "project search". So, I finally tried to harden helm-ag to support "rg" better. Hope this effort can make slight sense.
The changes I made in this PR includes:
helm-ag-base-command
with a rg command, like "rg --no-heading", helm-ag now:helm-ag-ignore-patterns
, and convert them into rg compatible format.helm-attr
andhelm-attrset
with 'helm-get-attrand
helm-set-attr`.helm-ag--construct-command
andhelm-ag--construct-do-ag-command
, they do same thing basically in different formats, very confusing. Now, consolidated underhelm-ag--construct-command
.Tests