Structural search in 4.1

I'm just wondering how the structure search works in 4.1

It looks really handy but I've got no idea how to use it. Can anyone give me an example?

11 comments
Comment actions Permalink

Look at my comments in
http://intellij.net/tracker/idea/viewSCR?publicId=34421

The bug I mentioned is fixed in the latest build. With that "query" you can find all usages of Vector.addElement() (and replace them with Vector.add()) - without finding any other methods that happen to have the same name.

But I agree: The interface is not very intuitive - I filed a couple of tickets for it. Most of the complexity is inherent though, so the UI will also be a little complicated.

0
Comment actions Permalink

Glen Stampoultzis wrote:

I'm just wondering how the structure search works in 4.1

It looks really handy but I've got no idea how to use it. Can anyone
give me an example?


Essentially, you provide a template of a piece of code that you want
find. For example, I've been experimenting with it to replace calls to
an assertion utility with Java assert statements.

One of the search templates looks like this:

ParamChecker.isTrue($exp$, $msg$);

And the replacement template is:

assert $exp$ : $msg$;

Ciao,
Gordon

--
Gordon Tyler (Software Developer)
Quest Software <http://java.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: 416-643-4846 | Fax: 416-594-1919

0
Comment actions Permalink

You are not alone. Seems to be a very powerful feature, but if nobody
can use it, it is quite useless.

Tom

0
Comment actions Permalink

it's really not intuitive yet.

Some good examples would help getting started - the
feature itself is great!

... what about the open API for structural search? ;)

0
Comment actions Permalink


"Gordon Tyler" <gordon.tyler@quest.com> wrote in message
news:cakkkn$k5u$1@is.intellij.net...

Glen Stampoultzis wrote:

>

I'm just wondering how the structure search works in 4.1

>

It looks really handy but I've got no idea how to use it. Can anyone
give me an example?

>

Essentially, you provide a template of a piece of code that you want
find. For example, I've been experimenting with it to replace calls to
an assertion utility with Java assert statements.

>

One of the search templates looks like this:

>

ParamChecker.isTrue($exp$, $msg$);

>

And the replacement template is:

>

assert $exp$ : $msg$;

>

That is cool. Thanks.


0
Comment actions Permalink

I hope for a good tutorial.

Tom

0
Comment actions Permalink

Hi,

There is many existing predefined templates (appears after Pressing
'Copy existing templates') that one could learn and use.

Michael Damberger wrote:

it's really not intuitive yet.

Some good examples would help getting started - the
feature itself is great!

.. what about the open API for structural search? ;)



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

I still hope for a good tutorial, which explains (with the help of an
example) why this or that option is used.

Tom

0
Comment actions Permalink

Hi,

We provide help which describes all the options.
The file is structuredSearch.html in ideahelp.jar!\idea\navigationSearch
Please, fill free to comment it.

Thomas Singer (MoTJ) wrote:

I still hope for a good tutorial, which explains (with the help of an
example) why this or that option is used.

Tom



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

appears after Pressing'Copy existing templates'


wow - had not seen that ;) thanks for the info.

if you make the tree of existing templates
immediately visible, e.g. just show it on top left,
but still also allow to enter free text - this would
make it much more easier for the complete novice IMHO

0
Comment actions Permalink

Hi,

It was there sometime ago but was removed for the simplicity of overall
dialog :)

Michael Damberger wrote:

>>appears after Pressing'Copy existing templates'


wow - had not seen that ;) thanks for the info.

if you make the tree of existing templates
immediately visible, e.g. just show it on top left,
but still also allow to enter free text - this would
make it much more easier for the complete novice IMHO



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

Please sign in to leave a comment.