ripgrep/tests
Stephan Badragan 292bc54e64 printer: support -r/--replace with --json
This adds a `replacement` field to each submatch object in the JSON
output. In effect, this extends the `-r/--replace` flag so that it works
with `--json`.

This adds a new field instead of replacing the match text (which is how
the standard printer works) for maximum flexibility. This way, consumers
of the JSON output can access the original match text (and always rely
on it corresponding to the original match text) while also getting the
replacement text without needing to do the replacement themselves.

Closes #1872, Closes #2883
2025-09-19 21:08:19 -04:00
..
data tests: fix tests for buffer size change 2021-03-23 18:14:18 -04:00
binary.rs tests: fix tests for buffer size change 2021-03-23 18:14:18 -04:00
feature.rs cli: prefix all non-fatal error messages with 'rg: ' 2024-01-06 14:15:52 -05:00
hay.rs tests: re-tool integration tests 2018-08-20 07:10:19 -04:00
json.rs printer: support -r/--replace with --json 2025-09-19 21:08:19 -04:00
macros.rs style: rustfmt everything 2020-02-17 19:24:53 -05:00
misc.rs ci: add more ARM build configurations to CI and release workflows 2024-01-06 10:21:34 -05:00
multiline.rs printer: vimgrep now only prints one line 2021-05-31 21:51:18 -04:00
regression.rs color: add italic to style attributes 2025-09-19 21:08:19 -04:00
tests.rs binary: rejigger ripgrep's handling of binary files 2019-04-14 19:29:27 -04:00
util.rs impl: switch most atomic ops to Relaxed ordering 2025-09-19 21:08:19 -04:00