expose --only-matching/-o option like ripgrep for only outputting the parts of lines that actually correspond to what was matched (vs always outputting entire lines)
To test:
Per newly added test cases, if you use --only-matching/-o and your matches don't constitute all of the text on all of the lines that they're on, you should only see the text corresponding to the matched tree-sitter AST node in the output
In this PR:
--only-matching
/-o
option likeripgrep
for only outputting the parts of lines that actually correspond to what was matched (vs always outputting entire lines)To test: Per newly added test cases, if you use
--only-matching
/-o
and your matches don't constitute all of the text on all of the lines that they're on, you should only see the text corresponding to the matched tree-sitter AST node in the outputBased on
more-languages