Search pattern question

Hi All.
I'm trying to figure out a way to find all violations of our code standart for if statements which is
USE:
if(class.Prop == expectedValue)
DO NOT USE:
if(expectedValue == class.Prop)

Let's assume that expectedValue is integer just for simplicity.
I created a pattern "$constant$ == $anything$" and I can't figure out which placeholder I should use for constant. I tried expression, argument and id. It doesn't help I either find correct and incorrect statements or all of them.
Is it possible at all to find such construct using current implementation of search pattern ?
Thanks in advance,
Maxim

3 comments

Uncheck "Match similar constructs" ;)

0

Thx for response.
I tried that one without luck. What placeholder types do you have in mind for case where it should help?

0

Unfortunately, there is no such option visible now. I've filed a request for that: http://youtrack.jetbrains.net/issue/RSRP-233186

PS As far as I remember, your original question was a bit different.

0

Please sign in to leave a comment.