Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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