syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.68k stars 4.89k forks source link

`SPC *` not working with ripgrep 14 #16200

Closed tko closed 9 months ago

tko commented 10 months ago

Description :octocat:

SPC * (spacemacs/helm-project-smart-do-search-region-or-symbol) stopped working.

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart: Invalid CLI arguments: unexpected argument for option '--ignore': ".#*"

Expected behaviour: :heart: :smile: Search results based on the pattern.

System Info :computer:

Brand new spacemacs install with just the defaults.

(Fairly sure it broke with update to 14 and was working with 13.)

gbastkowski commented 10 months ago

I "fixed" it for now by removing rg from dotspacemacs-search-tools. Last night I saw that I could get it working with rg by setting another variable from t to nil. But have no idea anymore which variable that was.

humitos commented 10 months ago

I'm experimenting the same issue and I wasn't able to solve it by myself exploring the Emacs code.

I solved it for now by downgrading ripgrep to version 13. In Archlinux I ran the following command and selected version 13.

sudo downgrade ripgrep
gbastkowski commented 10 months ago

My quick workaound: (setq helm-ag-use-grep-ignore-list nil)

emlun commented 10 months ago

I have the same issue. Seems related to emacsorphanage/helm-ag#388: notice that helm-ag--grep-ignore-list-to-options adds --ignore arguments, but ripgrep needs these to be --glob or --iglob arguments.

BenedictHW commented 10 months ago

I use ag and not rg, does https://github.com/emacsorphanage/helm-ag/pull/394 work with rg 14? Seems to pass the right arguments.

    (let ((got (helm-ag--construct-command nil))
          (expected '("rg" "--no-heading" "--glob=!*.md" "--glob=!*.el" "foo")))
JoshTRN commented 10 months ago

I have the same issue with SPC /, but @gbastkowski's suggestion worked for me as well.

johnnywalker commented 10 months ago

@BenedictHW I can confirm that https://github.com/emacsorphanage/helm-ag/pull/394 works with rg 14. Here's my solution:

  1. Override helm-ag to use branch from PR:
   dotspacemacs-additional-packages
   '(
     ;; support rg 14
     ;; https://github.com/syl20bnr/spacemacs/issues/16200
     (helm-ag :location (recipe
                         :fetcher github
                         :repo "zozowell/helm-ag"
                         :branch "further-support-rg")))
  1. Remove existing package: SPC SPC package-delete and type/select helm-ag

  2. Restart Emacs: SPC q r

smile13241324 commented 9 months ago

Thanks for the analysis guys :), I am going to change our target to https://github.com/emacsorphanage/helm-ag/pull/394 to keep spacemacs working.

fred-apex-ai commented 9 months ago

I updated to the latest develop branch including cb5f5b2, restarted spacemacs but still had the issue, so I downgraded ripgrep to v13.0.0 instead. Now I can search again

metaspace commented 9 months ago

I updated to the latest develop branch including cb5f5b2, restarted spacemacs but still had the issue, so I downgraded ripgrep to v13.0.0 instead. Now I can search again

I had to uninstall helm-ag and reload spacemacs to make the change take effect. The package is not reinstalled automatically. Maybe the version number was not bumped or something :shrug:

pataquets commented 7 months ago

Confirmed: Simply deleting helm-ag package and letting Spacemacs reinstall it fixed the problem right away. Thanks!

$ rg --version
ripgrep 14.1.0 (rev e50df40a19)