You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 believe ast-grep --json=stream doesn't.
Perhaps ast-grep --json=ripgrep could be identical to rg --json at the intersection of their output, but could also contain additional keys (e.g. language).
What do you want to use this for?
Processing ast-grep output with existing tools
What workarounds are you using in the meantime?
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:
⭐ 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: