> I wanted to find usage of a member called "io_pending".

DXR is happy to search for identifiers (id:whatever). The problem is that all 
the uses of io_pending are #ifdef'd out when compiling for Linux, which is the 
platform we use to run the indexing job for moz-central. A clue is that there's 
not much of a symbolic context menu when clicking on io_pending: you get 
offered only "Search for the substring io_pending". So, when you're searching 
for platform-specific things that aren't Linux, you have to fall back to text 
search. In addition, you have regexes at your disposal, so something using word 
boundaries like regexp:\bio_pending\b might serve.

> By default dxr tokenizes your input, so if you put "foo bar" (without quotes) 
> it will give you lines that contain both foo and bar, individually. That is 
> sometimes helpful, but not here.

Specifically, DXR finds all the lines that contain all the space-delimited 
terms in the query, due to long tradition. As Gijs and others point out, quotes 
can be used to match whole phrases. I've shopped around the idea of changing 
this behavior, but nobody seemed interested. If anyone feels strongly, the 
polls can be reopened!

>> - how can I simply limit search to be performed only in a certain
>> directory and it's sub-dirs?
> 
> foo path:browser/base/content/test/

You can also click any dir name in the search results, and you'll get a context 
menu including "Limit search to folder" and "Exclude folder from search".

Cheers,
Erik
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to