Code completion in Unity project is extremely frustrating

Answered

I've been having this issue regularly for the past 6 months or so, and I keep hoping it gets fixed with every new version but it keeps reoccurring. Every time I type out Vector3 I expect it to suggest the obvious type of "UnityEngine.Vector3" but Rider always suggests 'System.Numerics.Vector3' as the top pick. My files always have "using UnityEngine" so why on earth would it suggest a brand new type to import? Have I misconfigured my project somehow?

 

Also, maybe this is another configuration issue, but another common frustration is when I'm trying to create a new List<T> the "new" auto-complete suggestion can take 3-4 seconds to show up, so I end up having to type out the entire name of the type manually which kind of sucks. Definitely makes me reconsider why I'm paying for Rider.

 

Any suggestions on fixing either of those would be great. 

12 comments
Comment actions Permalink

Looking for somewhere to post this and this conversation seems mostly related. It would be so helpful to be able to mark a selection as the "best" selection or mark a suggestion as "less helpful". Even just be able to reset the algorithm that sorts would be great. The most frustrating situation to me is when a bad suggestion will get stuck above something that I use all of the time (like the Debug example above)

This is me right now

2
Comment actions Permalink

Thank you Sofia Byzova 🙂

Here is another example...

1
Comment actions Permalink

This problem still persists in 2021.3.3, and it's driving me bonkers! I honestly cannot understand why it would pre-select the Vector2 or Vector3 type that no import exists for in the file, when there is a Vector2 or Vector3 type for which one does exist in the file. 

Will implement the workaround, just wanted to note that it's still incredibly frustrating. 

[EDITED TO ADD]

Even with the workaround, and "uses UnityEngine" defined, Rider will auto-insert the fully-qualified type name? This is incredibly frustrating. Annoying enough to make me consider switching back to VS :(

1
Comment actions Permalink

Lynlisten, please check Preferences | Editor | General | Code Completion | Machine Learning Assisted Completion. If it is enabled, you can try disabling it, then it will use ranking mechanism. If ranking mechanism still does not show the results you choose more often, then you can try clearing caches via File | Invalidate Caches. It will take some time to collect statistics. If it still does not help anyway, then please open an issue on our tracker and attach more information like: logs and specific example when it does not work as expected. Please let me know how it goes.

1
Comment actions Permalink

I completely agree.  I posted about a similar problem here:

https://rider-support.jetbrains.com/hc/en-us/community/posts/360003397200-How-to-tell-Rider-which-assembly-to-get-a-symbol-from-

Rider keeps trying to autocomplete to the wrong assemblies.

0
Comment actions Permalink

Oh wow, so they definitely aren't reading these forums at all then. I'm pretty disappointed with JetBrains, this should be basic stuff but it's been a recurring nightmare lately. Might be time to switch back to Visual Studio to save my sanity.

0
Comment actions Permalink

Hello Jesse,

We do read these forums, please accept our sincere apologies for the delayed reply.

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.

We've adjusted completion in Rider 2019.1, and these bugs are most likely fixed there. Please let us know if you observe similar behavior on Rider 2019.1 EAP build or the stable release (planned for this month). 

0
Comment actions Permalink

Hi Julia,

Thanks for the reply. I did figure out that turning off 'Show import items" would fix it, but then how can I access code completion that _does_ show the import items? The keyboard shortcuts settings only shows a "Basic" and "SmartType" completion, neither of which show import items when that checkbox disabled. I've looked everywhere for some documentation on how to do this, but nothing seems to work - even the "Class Name Completion" (which is not even under the 'Completion' category in the settings) doesn't show imports.

I checked out the EAP build and it does seem to have those specific import issues fixed. However, other fundamental things are completely broken (adding a new file doesn't seem to be recognized by the project at all, until I restart Rider), so now I have two equally frustrating options to choose from.

I didn't even have this many issues using old versions of MonoDevelop that came bundled with Unity. Very disappointing.

0
Comment actions Permalink

Do I understand correctly, that in Rider 2019.1 the completion works well even with "Show import items" enabled? 

>adding a new file doesn't seem to be recognized by the project at all, until I restart Rider

Could you please provide steps to reproduce this? It looks major.

0
Comment actions Permalink

I have similar frustrations. Here is one example...

 

0
Comment actions Permalink

Hi Paul,

I've reproduced this issue and filed a ticket on Rider tracker: https://youtrack.jetbrains.com/issue/RIDER-49885. Please feel free to vote for it to subscribe for updates.

 

Sofia.

0

Please sign in to leave a comment.