Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@BurntSushi
addresses
not using json but something simple:
outputs in format:
file:line:col:byte_offset:match_size:match:
all the info is there for another tool to do efficient further processing as discussed in #359 or #795 (comment)
example
design choices
design questions
A tool can just use the match and compute the context by reading the matched file at corresponding location; but maybe we can also output context as follows:
for context within line: all info is present here since we have column + match size:
src/app.rs:1031:9:5399:9:123:here is the entire line:
in format:
file:line:col:byte_offset:match_size:line_total_size:line:
where
line_total_size
is useful in case we want to truncate at a max line lengthsrc/app.rs:1031:9:5399:9:123:here is previous line\n:here is the entire line\nhere is the next line:
in format:
file:line_of_context_start:byte_offset_of_context_start:byte_offset_from_context_start:match_size:line_total_size:multi_lines:
use cases enabled by this (via external tooling)
TODO