I have a problem with my custom language, I'm trying to highlight usages of the element under the caret, but not all usages are highlighted. In the following code,
fo<caret>o = "bar";
the first occurence of "foo" is correctly highlighted, but not the occurence under the caret. Ctrl-click leads me to the declaration, as expected, so resolve() seems to work okay.
The declaration PSI element implements PsiNameIdentifierOwner. Both occurences of "foo" are Identifier, which overrides getReference(). They resolve to the same declaration.
Any idea why the second foo is not highlighted?