Reference to class from xml

Hi guys, I have implemented a reference contributor that provides a reference from xml to Php class and it works well. But IDE highlights the whole string of an attribute value, for example Some\Long\Name\Of\Class - whole string will be highlighted.
Could you please point me out how I can highlight each part of FQN separately like it works for Java classes declared in xml

0
2 comments
Avatar
Permanently deleted user

I have a PsiReferenceProvider for Strings that returns references that extend

PsiReferenceBase<MString>

where MString is my PsiElement for strings. To highlight only a part of the string I simply use the constructor 

com.intellij.psi.PsiReferenceBase#PsiReferenceBase(T, com.intellij.openapi.util.TextRange, boolean)

The provided TextRange defines the range inside the PsiElement that should be used.

1
Avatar
Permanently deleted user

Thank you Patrick, works!

0

Please sign in to leave a comment.