Skip to content

Use the library ripgrep instead of relying on the executable rg #875

@liuchengxu

Description

@liuchengxu

ripgrep provides a library https://github.com/BurntSushi/ripgrep/blob/master/crates/grep/README.md which can be easily integrated into our Rust backend. The story is that while working on #872, I found that collecting the source items by invoking the shell command rg is somewhat annoying as the shell command does not produce items linearly, the output is empty from some point and then spikes suddenly, leading to a bad user experience. Responsiveness is really important. Maybe I did something wrong to collect the source item from the shell command, but with a quick experiment, I found using the crate grep helps resolve it and it'd also remove one explicit external binary dependency, hence I think it's a good addition.

Other potential benefits:

  • Once the new search syntax is supported, e.g., use +git to include only the results from git tracked files, using the library ripgrep may help skip the unrelated files at the stage of walking the directory.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions