Structural search question
Hi
How can I find both
static JButton x;
static JButton x = new JButton();
using a structural search.
I can find
static JButton x;
using
static $classname$ $varname$
but not both of the statements mentioned above.
Thanks for your help.
--Etienne
请先登录再写评论。
static JButton x = $Initial$;
For $Initial$ occurence count min 0, max 1
etienne wrote:
--
Maxim Mossienko
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Works like a charm.
Thanks Maxim!
And how about one more condition?
I want to find all static String fields which have non-literal initializer.
So I use the following template:
static String $FieldName$ = $Init$;
where $Init$ is not like: ".*", min occurs: 0 max occurs: 1
But it seems to me IDEA (#5261) finds all static String fields whatever initializer they have (e.g. private static final String ON_DELETE = "onDelete";).
What's wrong?
Hi,
SSR seems expand literal values when do comparison, try search for:
static String $FieldName$ = "$Init$";, Init should have inverted
condition of text .*
Dmitry Cherniachenko wrote:
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
Damn. Have just installed #5281 and it does not allow deleting characters in SS template editor. :( Cursor navigation with keyboard does not work either. :(
http://www.jetbrains.net/jira/browse/IDEA-7744
However, searching for
private String $Symbol$ = "$init$";
where $Symbol$ - occurs: 1, $init@ - not like .*, min:0, max:unlimited
still gives no results. :(
So, I suppose template is not quite correct. (IMO, .* matches anything, so inverting this condition just gives no matches)
Should I submit new request to JIRA?
Surely.
Dmitry Cherniachenko wrote:
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
Here it is: http://www.jetbrains.net/jira/browse/IDEA-7745