Issue regarding: Find Usages of Symbol
Please excuse my (most likely) stupidity with this post but I'm having some trouble with "Find Usages"
I have a variable that I know is used elsewhere in my project, but:
Using ´"Find Usages of Symbol" on this variable while the caret is on it, using Alt+F7 presents the message "Usages of 'variable' are only implicit" and gives no results.
If I however, right-click the variable in Structure View and choose "Find Usages" Rider correctly opens the respective file and highlights the usage.
This seems like a bug (I would assume both methods should behave the same), but perhaps I've missed a setting or something somewhere?
Thanks for any help in advance!
Please sign in to leave a comment.
Following on from this, Find Usages is causing trouble again in the following scenario:
Find Usages on lashesMesh does not show the usages seen below in the screenshot. The only usages presented are the variable's declaration and a prefab in Unity (which Rider opens and highlights for me) This time using Find Usages from the Structure view also only shows the declaration and Unity prefab.
Any ideas?
Hi!
Could you right click on `lashesMesh` and run Find Usages? Will you have same result? Which shortcut is assigned to Find usages in appeared context menu? Looks like when you pressing alt+f7 Rider runs Find unity usages instead of Find usages
Of course now I try and reproduce this issue, it doesn't happen again! I'm pretty certain I have been using the standard "Find Usages" in both cases.
I'll keep an eye out (it's happened a few times) and update when I have more information
Today I have a serialized, protected Transform variable in a class derived from MonoBehaviour, which is then referenced twice in a child-class, performing Find Usages does not show these usages; only the declaration and the Unity Assets using it.
Using Right-click menu Find Usages, or Find Usages from the Structure view, or using Alt F7 all result in lacking results.
If I remove SerizlizeField from the declaration, I get no results whatsoever with the message: "Usages of 'variable' were not found.". Using Find Usages in the Structure view does nothing, with no error.
After removing the declaration, Rider correctly lets me know that there are resulting errors and highlights the references when I click the "2 errors in 1 file" status bar message
Interestingly, if I revert my changes (removal of the declaration and its uses) using external source control, with Rider open, running Find Usages on the declaration works as expected.
Hello Robert,
To investigate this issue, we need a local reproduction.
Do you remember the revisions you switched between before reproducing the "Find Usages" issue? Knowing them could be very useful. So, if you know them, please collect your solution and your VCS (.git folder) and share them with us, and let us know the revisions numbers.
We can sign NDA if needed.
Here is a guide about how to upload files to JetBrains: https://rider-support.jetbrains.com/hc/en-us/articles/208199755-Uploading-Large-Files-for-JetBrains-Support-Team.
Please let me know if you need any assistance.
Kind regards,
Sofia.
I've deleted the solution files created by Unity forcing them to be recreated and things seem to be working better now
Sadly this was short-lived... the issue remains.
Unfortunately I'm not in a position to be able to share the project source with you. I'll keep an eye out and try and find any recurring similarities when the issue happens.
Is there any way of forcing some kind of refresh of the project in Rider?
Today's findings:
Appears to be Unity-specific classes that cause the issue. Today I've had an issue with public defined GameObject and Texture2D variables.
Disabling the Unity Plugin causes Find Usages to work as expected and finds usages in code
After opening the project without the Unity Plugin enabled, re-enabling the plugin and restarting has caused Find Usages of the variables to work as expected
Hi Robert,
>Is there any way of forcing some kind of refresh of the project in Rider?
One can call "Invalidate Caches and Restart" action https://www.jetbrains.com/help/rider/Cleaning_System_Cache.html.
Thanks! I'll give that a whirl.
I may have stumbled across the issue (quite possibly my own doing) so fingers crossed it's sorted now!