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!

0
13 comments

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?

0

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

0

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

0

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

0

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.

0

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.

0

I've deleted the solution files created by Unity forcing them to be recreated and things seem to be working better now

1

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?

0

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

0

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.

0

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!

0

It is 2024. I have the same very issue in Rider.Net. I guess some bugs are survivors and they refuse to go away.

I am trying to find the usages of a public const string. Finding Usages shows only the declaration spot. If I use Go To → Go to Declarations or Usages, the popup displays properly all the usages. And, yes, I tried invalidating the caches and I restarted Rider.net. The issue persists.

*sigh*

JetBrains Rider 2023.3.2
Build #RD-233.13135.100, built on December 19, 2023
Runtime version: 17.0.9+7-b1087.9 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows Server 2016 10.0
.NET Core v7.0.10 x64 (Server GC)
GC: G1 Young Generation, G1 Old Generation
Memory: 2400M
Cores: 6
Registry:
 editor.config.csharp.support=true
 ide.experimental.ui=true
 ide.mac.bigsur.window.with.tabs.enabled=false
Non-Bundled Plugins:
 com.myoutdesk.tailwind_formatter (2.0.9)
 com.microsoft.vso.idea (1.162.2)
 com.intellij.resharper.azure (3.50.0.1755-2023.3)
 

 

0

Hello,

Could you please share a screencast showing the Find Usages action producing incorrect results in your solution? Also, please clarify in which files you have those symbol usages that are not found? Are those files included in the project model in Rider and is code analysis enabled there?

A full bundle of Rider logs would also be helpful for investigation.

0

Please sign in to leave a comment.