I am out of ideas here. My reference resolving is working correctly but the FindUsage highlighting is missing to mark an element, although I did FindUsages on this element. Here is a screenshot:
In the first line is the definition of head and it is used in the following two lines. You cannot see the cursor, but I started FindUsage on the second head which is not highlighted. When I do a "go to declaration" on this element, I correctly jump to the first "head=1". I have checked the reference connections between the elements and they seem fine. When I change the second line to "sym_?head", which is correct Mathematica syntax too, the element is highlighted as it should be. I have checked the implementations for the PsiElements in question and I cannot find a difference compared to the "?" operator.
Question: Is it possible that the underscore prevents the correct finding of the last part in sym_head because in Java it is a valid identifier part? Is there something else I can check?