PsiReferences and PropertyValueImpl class

I have some PsiElements which are references from Property files.  I have the reference resolution and variants working very well.  However, when I try to do the Rename Refactoring or Find Usages, it won't find the references from the properties file.  My Find Usages provider checks to see whether it "canFindUsagesFor" the resolved PsiElement; so, I'm not sure why it's not looking in the properties file.

The PsiReferences I create are bound to instances of PropertyValueImpl.

2 comments
Comment actions Permalink

Hello Brad,

The default find usages/rename searches only for occurrences in code. Text
in property files is not considered code, so it isn't searched. You need
to provide your own query executor for the ReferencesSearch query that would
look in property files. (I think you can find numerous examples of this in
the CE source code.)

I have some PsiElements which are references from Property files.  I
have the reference resolution and variants working very well.
However, when I try to do the Rename Refactoring or Find Usages, it
won't find the references from the properties file.  My Find Usages
provider checks to see whether it "canFindUsagesFor" the resolved
PsiElement; so, I'm not sure why it's not looking in the properties
file.

The PsiReferences I create are bound to instances of
PropertyValueImpl.

---
Original message URL:
http://www.jetbrains.net/devnet/message/5263933#5263933

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

As soon as I implemented by custom FindUsagesHandlerFactory with a custom FindUsagesHandler with the custom query like you mentioned, it worked like a charm.  Thanks.

0

Please sign in to leave a comment.