Closed Bug 771000 Opened 14 years ago Closed 10 years ago

Ability to configure the number of lines of context shown in results at search time

Categories

(Webtools Graveyard :: DXR, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: MattN, Assigned: new_one)

References

Details

Attachments

(1 file)

It would work like the "-C"/"--context" option to grep. Sometimes there are many matches for a string or identifier but you only care about ones that have a certain argument or are preceded/followed by some other text. The results can be narrowed down by including more context and then using find-in-page of the browser. Bonus points if one can also specify the grep equivalent of --before-context and --after-context separately and at the same time.
Assignee: nobody → peter.elmers
I'll take this bug! Instead of offering the option to add lines of context, I think we'll go with the always-available option of having a button in the results menu to expand context around lines. Screenshot attached!
Hey Peter, the screenshot doesn't show the boundary of the extra context so it's hard for me to decipher how you're planning for this to work. Are the icons in the gutter relevant to this bug? Are you proposing that we show 0 lines of context in the initial rendering but then a user can manually show context by clicking something near each match line? If so, it's much less useful than being able to specify context for all match ahead of time. I want to be able to change the context for all matches so I can then do a find-in-page with my browser to find a second string near the search string.
Status: NEW → ASSIGNED
Yes, the gutter icons are clickable and load more context to the result. The context lines are faded out a bit from the actual results. You may consider a userscript that clicks all the buttons at once if you need all the contexts.
What's the advantage of the approach you're proposing, especially when people are used to grep behaviour? Do you have reason to believe that it's more desired of the two?
The main advantage is that you'll always have ability to see context, without needing to re-run the search with an extra option attached. Second you can pull more context either above or below if you feel that the initial results is not enough, which would require re-search with context as an option.
Commit pushed to master at https://github.com/mozilla/dxr https://github.com/mozilla/dxr/commit/21c456d44051188c6b83779bffc6ec66ceddf46e Add context expansion to LINE search results. Remove tables from the results layout, and add a button on the left to expand context by querying the new 'lines' app endpoint. Maybe fixes bug 771000.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
See Also: → 1414954
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: