Rename psi-to-file reference on file rename? Follow
Hi,
I have a PsiReference element which references a PsiFile in the project.
Renaming the PsiFile does not seem to invoke my PsiReference.handleElementRename, though.
Is there any way to be notified when the references PsiFile is renamed?
Thanks!
Wallaby
Please sign in to leave a comment.
You should be notified if Find Usages is working on the file in the project view. Have you got a ReferensesSearch registered?
Also, if your reference is a something like a quoted string, make sure getRangeInElement() returns the range without the quotes (e.g. 1, text.length()-1).
Usually references are automatically found if isReferenceTo() and getRangeInElement() are working correctly.