DXR Result Mixing

From MozillaWiki
Jump to: navigation, search

A common complaint in DXR is that it's hard to search for files by name. You have to use a special path: specifier. Also, to find an identifier, you have to know what kind of entity it represents. Even in the DXR Query Language Refresh, you have to say id:. We can simplify a lot of these use cases with some basic search result mixing. Here's an early sketch:

Results for "woof":

(folder icon) boog/woof  -- Don't list any more of the subtree; that would be ridiculous. Save that for if somebody actually says "path:woof*".
(file icon)   foo/bar.c:
                 1  "woof" says the dog  -- Plain text
                15  int woof;            -- An identifier, in a standout color

And then provide some way to toggle on and off certain kinds of matches: path, text, identifier. There's no point in showing each kind of thing separated into its own section, because how often do you care about all possible interpretations of your query? You care about the one you meant. So we show everything, easily visually pick-apart-able, and give you switches to mechanically hide certain interpretations if there is too much of no interest to visually filter out. With luck, the thing you were interested in is above the fold, and you don't have to mess with switches.

Results are still grouped by path and ordered by line, which people seem to like.

I could still see calling out a matching identifier at the top if it was, say, the only matching identifier, but it should also occur in the mix.