Expose line/column ranges for compute regexp capture groups
Created by: rvantonder
We postprocess search results by running the input regexp pattern over the entire file. When regexp engines return matches, they don't do bookkeeping over line numbers, and that's the case here. We get absolute offsets in the file, and no line/column ranges. There are two resolutions:
-
- Actually compute logical matches that may span multiple lines in our regexp search backends (searcher and Zoekt). These need to be exposed through a result type that does not break the result into line matches. This is a difficult task, since many parts of our code has come to rely on assuming strictly-line based matches
-
- Convert offsets to line/columns. This is extra work and needs to be efficient for large data sets (typically chopping the file into a sorted list of lines corresponding to offsets and then doing a binary search on the offsets to resolve lines/columns).
No functionality currently relies on line/column data, but this is going to be a no-brainer once we want to, e.g., link data points or results from compute to ranges in files.