Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPC * not working with ripgrep 14 #16200

Closed
tko opened this issue Nov 29, 2023 · 11 comments
Closed

SPC * not working with ripgrep 14 #16200

tko opened this issue Nov 29, 2023 · 11 comments

Comments

@tko
Copy link
Contributor

tko commented Nov 29, 2023

Description :octocat:

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

Reproduction guide 🪲

  • Start Emacs
  • Open a file in a project, say .emacs.d/init.el
  • Move cursor over any word
  • Press SPC *

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

Expected behaviour: ❤️ 😄
Search results based on the pattern.

System Info 💻

Brand new spacemacs install with just the defaults.

  • OS: darwin
  • Emacs: 29.1
  • Spacemacs: 0.999.0
  • Spacemacs branch: develop (rev. 8f70193)
  • Graphic display: t
  • Running in daemon: nil
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(emacs-lisp helm multiple-cursors treemacs)
  • System configuration features: ACL GNUTLS JSON LIBXML2 MODULES NOTIFY KQUEUE PDUMPER SQLITE3 THREADS TOOLKIT_SCROLL_BARS TREE_SITTER XWIDGETS ZLIB

  • ripgrep 14.0.2

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

@gbastkowski
Copy link
Contributor

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
Copy link

humitos commented Nov 29, 2023

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
Copy link
Contributor

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

@emlun
Copy link

emlun commented Nov 30, 2023

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
Copy link
Contributor

BenedictHW commented Dec 1, 2023

I use ag and not rg, does emacsorphanage/helm-ag#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
Copy link
Contributor

JoshTRN commented Dec 16, 2023

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

@johnnywalker
Copy link

@BenedictHW I can confirm that emacsorphanage/helm-ag#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
Copy link
Collaborator

smile13241324 commented Dec 31, 2023

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

smile13241324 added a commit that referenced this issue Dec 31, 2023
@fred-apex-ai
Copy link

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
Copy link

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 🤷

@pataquets
Copy link
Contributor

pataquets commented Mar 10, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests