Structural search 0.5 is available Follow
Structural search plugin is available, it allows searching the code in terms of example Java code (query by example:-).
http://www.intellij.org/twiki/bin/view/Main/StructuralSearchPlugin
Features:
- Exact matching of expressions
- exact matching of statement or statement group
- Loose matching of class or interface
- Loose matching of javadoc metadata
- Parametrization (substitutions) in templates
- Constraints for substitutions
Please sign in to leave a comment.
Hmm... Sounds interesting, but I can't find the link to the zip or jar.
Amnon
"Maxim Mossienko" <maxim@tercom.ru> wrote in message
news:6263332.1061830341838.JavaMail.itn@is.intellij.net...
terms of example Java code (query by example:-).
>
>
You can get it from
http://maximmossienko.newmail.ru/. I haven't tried it yet, though.
HTH,
Andrei
"Amnon I. Govrin" <agovrin@freshwater.com> wrote in message
news:bidsb5$433$1@is.intellij.net...
>
>
>
>
What is structural about it?
I guess I need some more explanation and an example or two...
Thanks,
Amnon
"Maxim Mossienko" <maxim@tercom.ru> wrote in message
news:6263332.1061830341838.JavaMail.itn@is.intellij.net...
terms of example Java code (query by example:-).
>
>
Available from: http://maximmossienko.newmail.ru/SS05.jar
The search is done in formatting independent way, based on user specified code structure.
Please, see more detailed description at
http://www.intellij.org/twiki/bin/view/Main/StructuralSearchPlugin
Here are short examples:
1. search for casts to given type one could use query:
()'T, where ]]> is type of interest, 'T is substitution
2. classes since particular release:
/** @since 1.4*/ class 'T {}
3. Possible factory pattern calls:
'aVar = 'aType.'aConstructionMethod:create.+ ();
aVar, aType, aConstructionMethod are substitutions,
aConstructionMethod should be like create.+ regular expression
4. Interface which have the method of interest:
interface 'InterfaceOfInterest {
PsiJavaCodeReferenceElement 'MethodWhichIsNew();
}
Better work with list of package names search scope:
http://maximmossienko.newmail.ru/SS051.jar
Please, feel free to report the problems
The filename is wrong... The correct link is
http://maximmossienko.newmail.ru/SS051.jar%20
Thank you for the correction.
Maxim, how can I use it?
Is it plugged in menu, or somewhere else?
I cannot locate it. The standard search windows looks the same.
U¿ytkownik "Maxim Mossienko" <maxim@tercom.ru> napisa³ w wiadomo¶ci
news:6263332.1061830341838.JavaMail.itn@is.intellij.net...
terms of example Java code (query by example:-).
>
>
It appears as last icon on the toolbar
Need some explanation too.
Think it can be very powerful. Can u give as some "silly" examples, that show the worth of this kind of search?
Structural search 0.5.2 is available:
http://maximmossienko.newmail.ru/SS052.jar
- better searching in Aurora projects with multiple source folders
- built-in error reporting
- bug fixes
This kind of search is intended to be convenient during nontrivial and/or massive refactorings or new code understanding when one needs searching something that is dependent on code context or has exact syntax/semantic form (but independent of formatting). In these situations simple string search or even find usages could be of relatively little value or inconvenient.
Consider finding casts or instanceof for particular classes or interfaces, several subsequent statements of certain form, specific class/method/expression structure, etc, etc
Yeah, that sounds really great ;).
Tryed the following:
marked "instanceof Goal" --> Running Structural Search
Results: "()"...
What did I wrong?
Try to use well formed expressions, like:
'_ instanceof Goal