Add the possibility to have few lines of context in a search results
Categories
(Webtools :: Searchfox, enhancement)
Tracking
(Not tracked)
People
(Reporter: calixte, Unassigned)
Details
I use a lot the options -A
and -B
with ripgrep to get few lines of context around the queried string.
From my point of view it's super useful to quickly guess what's relevant for me.
Comment 1•3 years ago
|
||
We support context:
in the search query fwiw: https://searchfox.org/mozilla-central/search?q=context%3A10+foobar&case=true&path=
Reporter | ||
Comment 2•3 years ago
|
||
Nice !!
How could I have found that myself without filing a bug ?
It seems that's it works only for textual occurrences:
https://searchfox.org/mozilla-central/search?q=context%3A5+defineLazyModuleGetters&path=
Comment 3•3 years ago
•
|
||
It's unfortunately a secret feature at this time because, as you discovered, it is only for full-text search. More details/rationale at https://github.com/mozsearch/mozsearch/pull/417
We're much closer to being able to provide this across result types. For the time being you can force a full-text search by using a path filter or enabling regexp. (Semantic results suppress full-text search results on the same lines, so in order to get full-text results only and therefore context, we need to not do semantic searches.)
Description
•