Rename psi-to-file reference on file rename?

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

2 comments
Comment actions Permalink

You should be notified if Find Usages is working on the file in the project view. Have you got a ReferensesSearch registered?

0
Comment actions Permalink

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.

0

Please sign in to leave a comment.