How to tell Rider which assembly to get a symbol from?
I'm having a really annoying problem, strangely only at work, where I am using Rider with a Unity project and every time I start to type out Debug for Debug.Log, Rider wants to add a using statement for System.Diagnostics.
The file is already using UnityEngine, and I've even gone so far as to do using Debug=UnityEngine.Debug but it doesn't matter. Every time I start typing Debug, Rider wants to use System.Diagnostics and if I don't type out Debug completely every time, Rider will insert that new Using statement and screw things up.
How can I tell Rider to stop trying to use that System.Diagnostics symbol?!!
Please sign in to leave a comment.
Anyone? This is driving me crazy and making Rider a huge pain point.
Does anyone from Jetbrains actually read the support forums? Seems everything posted here has 0 replies on average.
Hello John,
As a workaround, you can turn off "Show import items in basic completion" checkbox in "File | Settings | Editor | General | Code Completion". With this setting disabled, Rider won't suggest non-imported symbols in the completion.
Unfortunately, I didn't manage to reproduce the bug. The Debug.Log from Unity Engine is always on top of the completion lookup for me. What is your Rider version? Are you typing in Unity-generated solution or in a ClassLib?
Rider version is 2018.3.3
As for the project solution, it is actually a complicated answer and I suspect may have something to do with why I only have this problem in this project t work and none of my own personal ones.
It is a Unity generated solution, and I open Rider by selecting "Open C# Project" in Unity. However the code I am working in is a Unity Package (in unity project structure, it is Packages/Foo) that is used by the Unity project. In Rider, with the workspace view set to Unity, I get to my code by opening Packages rather than Assets.
Maybe this is an edge case that is causing the bug?
Could you please try Rider 2019.1 EAP? There is a good chance that it was already fixed.
I'm using Rider 2019.1 and this is still happening
Whenever I type Debug.Log, the first suggestion is always System.Diagnostics (even when UnityEngine is already imported in the file!!!!)
Victor,
We're investigating the wrong suggestions bug, please watch this issue for updates: https://youtrack.jetbrains.com/issue/RIDER-28545
Can we PLEASE get this fixed already?
I'm about to smash my keyboard i'm so frustrated with Rider right now. I WANT UNITYENGINE.DEBUG how do I get you to understand this you stupid software??
By the way the linked issue is marked as fixed, yet clearly isn't. Of course it will probably be another month before anyone sees this.
Hello John,
I'm sorry for the inconvenience. We are on this issue https://youtrack.jetbrains.com/issue/RIDER-33445. Please watch it for updates.
Sofia.
Hi Sofia,
Can you please tell me how this goes from a BUG that was FIXED in issue 28545, to a regression that gets opened as a new issue and is now only a USABILITY PROBLEM that would be Nice to Fix in 33445?
This was a bug before and deemed worth of fixing (even though the fix either regressed or wasn't wholly fixed) so why is it considered less than that now? I don't think you understand how infuriating it is dealing with this problem. This one bug alone is making me want to cancel my subscription to Rider. It is that annoying. And it isn't just Debug. Now lately UnityEngine.Random has been conflicting as well.
Look, Rider is extremely Unity aware. It knows I am working on a Unity project, so it should be a no brainer for Rider to prioritize conflicting symbols as being in UnityEngine or UnityEditor over System.
I know this is 2021, but I'm still having this issue. Is there any update on this?
Jaden, what exactly are you getting? It would help a lot, if you call Help - Report a Bug, right after reproducing the problem, explain, what are you seeing and agree to attach logs. Thank you!
I know this is old, but I had the same problem except Rider constantly kept auto importing “System.Numerics.Vector3” when i of course wanted UnityEngine.Vector3.
Im using Rider 2024.2.1 just in case this is different, but in Settings - Editor - Auto Import you can filter out assemblies you dont want.
Hello,
I guess that in the latest version of Rider this is likely related to how the ML model sorts completion suggestions. We have a corresponding issue on our tracker: RIDER-63160 Machine Learning-Assisted Completion often prefers System.Numerics. over Unity's own types. Vector3, Quaternion etc. We would appreciate it if you upvote the request to indicate additional interest.