Re: DXR Shorthand search

2013-02-20 Thread Erik Rose
 Thanks Erik

No problem! Ah, and the + in front of some of those queries means use the 
fully qualified name, and require an exact match. (Thanks, abbeyj.)

Erik
___
dev-static-analysis mailing list
dev-static-analysis@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-static-analysis


Re: DXR Shorthand search

2013-02-20 Thread Erik Rose
I should also mention that we're thinking about not having contains searches 
happen by default: https://github.com/mozilla/dxr/pull/104
___
dev-static-analysis mailing list
dev-static-analysis@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-static-analysis


Re: DXR Shorthand search

2013-02-20 Thread Erik Rose
 I have a Firefox keyword for searching with old DXR. Is there a hope we
 can enter search criteria directly in the url?

I don't see why not. Hit Return in the search field, and you'll get a URL like 
this:

http://33.33.33.77:8000/search?tree=codeq=readmeredirect=true

You could easily sub the query in for the q= query param. The only 
questionable bit would be url escaping, which FF handles well. However, I could 
see the + sign getting interpreted as a space.

Erik
___
dev-static-analysis mailing list
dev-static-analysis@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-static-analysis


Re: DXR Shorthand search

2013-02-20 Thread Schalk Neethling
Thanks everyone for your feedback and please keep it coming. I am 
iterating over the new UI but, will most likely push it somewhere where 
everyone can use it an provide further feedback by the end of today or 
tomorrow.


I really want to tweak this until we get as perfect a UI as we can that 
works well for both new and experienced users.


On 2/21/13 12:01 AM, Jonas Finnemann Jensen wrote:

Okay, well... I see others have listed most of them while I was crafting
a reply :)
I guess you miss - the negation operator, which can be applied to
everything, and phrase search with Hello World.
I've add some examples below with the explanation, I had already written...

dxr/query.py lists the following parameters:
path, ext, type, type-ref, function, function-ref, var, var-ref, macro,
macro-ref, callers, called-by, warning, warning-opt, bases, derived,
member, regexp

In general if parameters like (e.g. function:printf) are are prefixed +
(e.g. +function:printf)
they are searching for exact matches of fully qualified names.
This is mainly useful for automatically generated links, for example
references of a specific function:
+function-ref:mozilla::layers::ImageLayer::SetContainer(class
mozilla::layers::ImageContainer *)

The useful part is that users can now add additional constraints to the
search query, say only results from layout/generic folder
path:layout/generic
+function-ref:mozilla::layers::ImageLayer::SetContainer(class
mozilla::layers::ImageContainer *)

It is also possible to search for phrases with my phrase (phrases
allows you to search for whitespace).
You can also give a phrase to a parameter, ie. path:  to find the only
file in mozilla central with whitespace in it's name :)

Regular expressions are written as regexp:/abc.*d/ or regexp:#[0-9]*/[0-9]*#
Ie. starts and ends with the same character like in vim.
This might be confusing, it certainly can be when using the advanced
search widget which tries to help with this.
(Regular expression syntax is documented at
http://code.google.com/p/re2/wiki/Syntax)

All parameters, keywords and phrases can be prefixed - to exclude results.
For instance all files in gfx/layers with the exclusion of cpp files:
path:gfx/layers/ -ext:cpp

Notice, + and - can be combined, ie. -+type-ref:mozilla::layers::BufferMode
Ordering of + and - does not matter, the semantics are the same, in this
case exclusion of all results with references to
mozilla::layers::BufferMode.

Note:
This search interface is powerful and reasonbly consistent, but not
necessarily user friendly.
So it might be worth considering minor adjustments, if users find it
hard to use.
In particular I can imagine that the regular expression parameter,
regexp: is hard to use.
  - But then again regular expressions are not particularly user
friendly by nature :)


--
Regards Jonas Finnemann Jensen.


On Wed, Feb 20, 2013 at 10:06 PM, Schalk Neethling
sneethl...@mozilla.com mailto:sneethl...@mozilla.com wrote:

Thanks Erik


On 2/20/13 11:03 PM, Erik Rose wrote:

Below is what I have, what other syntax is also supported?


Here are some more from the test suite:

function: finds function declarations

callers: finds call sites of a function

called-by: finds all the functions called by a specific function

+function: finds matches to a specific signature (I think).
Example: +function:ConstOverload::foo() or
+function:ConstOverload::foo(__) const

+var:prototype_parameter___function(int)::prototype___parameter
+var-ref:prototype_parameter___function(int)::prototype___parameter
find variables of some kind or other

+macro-ref: finds references to a macro

member: finds members of a class

+type: finds typedefs
+type-ref: finds uses of a type

Erik


--
Kind Regards,
Schalk Neethling
Front-End Engineer
Mozilla
_
dev-static-analysis mailing list
dev-static-analysis@lists.__mozilla.org
mailto:dev-static-analysis@lists.mozilla.org
https://lists.mozilla.org/__listinfo/dev-static-analysis
https://lists.mozilla.org/listinfo/dev-static-analysis




--
Kind Regards,
Schalk Neethling
Front-End Engineer
Mozilla
___
dev-static-analysis mailing list
dev-static-analysis@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-static-analysis