Unity Code Completion

I recently downloaded Rider to use with my Unity projects. From what I saw in the description, it should autocomplete for Unity, but it isn't.

I followed the getting started guide, and have Mono installed, but it still isn't showing any autocompletes for Unity. How do I get these to work?

 

0
5 comments

Hello,

Could you please share a screen record or a code example on which autocompletion does not work?

Also, please share a screenshot of the whole Rider window with the opened c# file, and all logs collecting via the action "Help | Collect Logs".

One can upload all the files using the uploads.jetbrains.com service.

 

K.R. 

Sofia.

0
Avatar
Permanently deleted user

I have the same problem, so maybe I could provide some information:

I don't get any code completion related to unity at all.

This is the current code example:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class AdventureGame : MonoBehaviour
{
private Text textComponent;

// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{

}
}

Typing "using UnityEngine.U", I would assume code completion to suggest "UnityEngine.UI", but it does not suggest anything. When typing "private Tex", it does not suggest the type "Text"; instead, the only suggestion I get is "protected". I uploaded a screenshot of the suggestion:

Upload id: 2020_11_04_5aAV2UfbAx48B3bY

I hope this helps. If I can provide additional information to help you guys, I will gladly do so. I hope we can find out what is missing and how to fix it.

0
Avatar
Permanently deleted user

By the way, I just noticed this:

When trying to access textComponent from within the Start method, typing "te" does not even give me "textComponent" as a suggestion. I would expect Rider so notice that I have the textComponent property defined that I may want to access in start:

Upload id: 2020_11_04_2G7iNiwyviLKFRZR

0
Avatar
Permanently deleted user

Ok, it seems I fixed it. Previously, I only installed Mono on my OpenSUSE Tumbleweed system, thinking this should be enough.

But now I also installed .NET by following this guide and code completion seems to work now for Unity. I am not familiar with .NET/Mono, so I can't comment on what exactly was missing.

0

Hi @...,

Thank you for the information. It is great you've solved this issue.

The thing is that analysis was not enabled because you did not have csharp project loaded.

Rider told about this.

To fix this issue one needs to set a proper MSBuild in on Rider settings page `File | Settings | Build, Execution, Deployment | Toolset and Build`. But before it is necessary to install SDK. You had mono installed, so, build should be detected automatically. It seems to be a bug. Please clarify your Rider version, mono version, Unity version. 

1

Please sign in to leave a comment.