Closed Bug 1041827 Opened 11 years ago Closed 10 years ago

Search for multiple extensions at once

Categories

(Webtools Graveyard :: DXR, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: erik, Unassigned)

Details

(Whiteboard: easy)

The by-extension search, ext:js, for example, supports only 1 extension at a time. This is drag for finding, say, all C code (.c, .h, .cpp) or all code in which JS may occur (.html, .js, .jsm). 1. We should certainly OR "ext:" filters together if multiple ones are used. "ext:c ext:h" should not come back empty. 2. We may also consider a syntax for supplying multiple extensions at once, without repeating the filter name: something like "ext:c,cc,h", for example.
I'll start working on this if no one else is doing anything.
Er, scratch that, actually. Just saw that the platform was MAC. Sorry.
You can ignore the Platform fields almost all the time in DXR; Bugzilla just likes to set those by default according to the platform of whomever opens the bug.
OS: Mac OS X → All
Good to know. Thank you for clarifying.
And in the https://wiki.mozilla.org/DXR_Query_Language_Refresh, we will almost certainly introduce a generic OR operator.
What would be the best way to fix this bug then? It looks like supporting "ext:cpp,h" would be easy: just update the ext filter in query.py. If that's acceptable, I'd be happy to try. Such a change would probably go away with the new query language, but if the new query language gets done in say a year, I think it's worth it.
Let's start with the comma-based syntax (ext:cpp,h). There's no reason that can't survive the query language refresh; it's unambiguous (for extensions that don't contain commas, which would be weird) and a lot better than typing "ext:h OR ext:cpp".
Fixed in https://github.com/mozilla/dxr/commit/31d4b18de327a71e27a9a7ab472c287aff3c066e. We can now combine ext filters and they will be OR'ed together, so we can search "ext:cpp ext:h <text>".
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.