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
[feature] Support ripgrep JSON format #768
Labels
enhancement
New feature or request
Comments
Hi @dandavison, thanks for giving ast-grep a try! I'm also a delta fan :) Adding I will consider supporting it in the future! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
⭐ Suggestion
Hi @HerringtonDarkholme, ast-grep looks great. What do you think about adding support for ripgrep's JSON output format, so that tools that have been written to handle ripgrep's format would automatically work with ast-grep. (I'm the author of delta, which can render ripgrep's JSON format; see https://github.com/BurntSushi/ripgrep#related-tools:
).
In addition to the fact that ripgrep is popular and tooling has been written that targets its JSON format it's possible ripgrep's JSON format has other advantages, for example,
rg --json
retains non-matching context lines when-A
,-B
, or-C
are used, whereas I believeast-grep --json=stream
doesn't.Perhaps
ast-grep --json=ripgrep
could be identical torg --json
at the intersection of their output, but could also contain additional keys (e.g.language
).💻 Use Cases
Processing ast-grep output with existing tools
People could write scripts to transform ast-grep into ripgrep format (have to coalesce successive matches into a single record), but it wouldn't be very convenient/portable, and wouldn't get around the problem that context lines are missing.
The text was updated successfully, but these errors were encountered: