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
Yeah, that would be nice but might also be problematic. When having context: boolean the search engine can decide, e.g. show 5 lines (two above & below) for normal matches but only show parts of a line for monster lines
Sometimes it's up to the user how much context should be shown. In Atom I can change leading and trailing context via the UI independently.
If you are showing results as text with context, is it annoying that multiple results on one line are given as multiple result objects, possibly with overlapping previews? Should the API keep the one-result-per-line model instead?
One difficulty here is when you have a long line with one match at the beginning and one at the end.
But to extend the current model to that I think would only require us to change the two ranges to Range|Range[]
I'm referring to something else, not context lines. When you have two matches on the same line, the API will send two result objects. For your extension, it might be better if you can get a single result object that indicates the two matches. That's what I mean by one result per line.
This is all kind of tangential but related because it probably doesn't make sense to show the same context lines twice when there are two matches on one line.
Opened #59919 for the other topic, the API change for context would look like this:
exportinterfaceTextSearchOptionsextendsSearchOptions{// .../** * Lines of context after the match */afterContext?: number;/** * Lines of context before the match */beforeContext?: number;}exportinterfaceTextSearchContext{/** * The uri for the matching document. */uri: Uri;/** * One or more lines of text. * previewOptions.charsPerLine applies to this */text: string;/** * The range of this context within the document. */range: Range;}exporttypeTextSearchResult=TextSearchLineMatch|TextSearchContext;
I think we would sort all of these results on the frontend.
Activity
roblourens commentedon Sep 26, 2018
I would add
jrieken commentedon Sep 27, 2018
Yeah, that would be nice but might also be problematic. When having
context: booleanthe search engine can decide, e.g. show 5 lines (two above & below) for normal matches but only show parts of a line for monster linesroblourens commentedon Sep 27, 2018
Sometimes it's up to the user how much context should be shown. In Atom I can change leading and trailing context via the UI independently.
If you are showing results as text with context, is it annoying that multiple results on one line are given as multiple result objects, possibly with overlapping previews? Should the API keep the one-result-per-line model instead?
One difficulty here is when you have a long line with one match at the beginning and one at the end.
But to extend the current model to that I think would only require us to change the two ranges to
Range|Range[]jrieken commentedon Sep 28, 2018
That means to show more context (line above/below) the file needs to opened and I don't that feasible...
roblourens commentedon Sep 28, 2018
I'm referring to something else, not context lines. When you have two matches on the same line, the API will send two result objects. For your extension, it might be better if you can get a single result object that indicates the two matches. That's what I mean by one result per line.
Kai had the suggestion of just using exactly ripgrep's format: https://burntsushi.net/stuff/libripgrep/doc/grep_printer/struct.JSON.html
This is all kind of tangential but related because it probably doesn't make sense to show the same context lines twice when there are two matches on one line.
[-]Make previewOptions more like -C option [/-][+]Text search should support context[/+]roblourens commentedon Oct 3, 2018
Opened #59919 for the other topic, the API change for context would look like this:
I think we would sort all of these results on the frontend.
#59458 for editor matches, tests
roblourens commentedon Oct 31, 2018
Please verify by calling the findTextInFiles API from an extension with the context options, check that you get something reasonable.