Search code examples
c#.netlinuxunity-game-enginerider

Rider redirects to online MSDN documentation -- can I get offline comments for C#?


I am working on a Unity project (idk if that's relevant), but very often whenever I try to view a quick documentation popup in JetBrains Rider with CtrlQ the popup contains only the link to the online learn.microsoft.com page without providing any sensible inline help. This really hinders my workflow and forces me to make mental context switches.

enter image description here

Is this really the whole content of quick documentation that is available for those elements or is something broken on my side? Is their documentation reaaaaally that scarce? I thought that some basic doc for Enumerable.<LINQ queries> or Regex.* would be present... (@EDIT even simple things like Console.WriteLine() are missing inline docs...)

Can I get the offline MSDN documentation that would be displayed in this popup?

Could it be a problem with my mono/dotnet installation, and if so how can I fix it?

IMPORTANT: I'm on Ubuntu 20.04 and using Rider 2021.3.2. I've also installed the documentation module for my unity editor instance, but I doubt it comes with MSDN included.


@UPDATE: It seems to be a unity/assembly problem, as plain C# projects do have inline documentation hints, only projects generated by unity are missing them. I tried reinstalling unity editor instance from the hub, but the documentation is still missing.


Solution

  • It turns out it is a Unity problem. I Managed to fix that (but it's hacky) using this unity forum thread as a reference and this bug report. I located the netstandard.xml files across my system (locate netstandard.xml command on Linux) and put it under /.../Unity/Editor/2021.2.8f1/Editor/Data/NetStandard/ref/2.1.0/netstandard.xml. (previously there was only a netstandard.dll with no xml file there).

    Why isn't this shipped with the unity itself is beyond me. I had luck because I could easily find the location of my dotnet-sdk files on my machine.

    If someone has other working and less hacky solution, I am happy to accept it.


    @EDIT seems like unity broke something once again, because this solution no longer works... After going to symbol for any thing (e.g. ArrayList's Add()), the decompiled sources point to .../Unity/Editor/2022.1.22f1/Editor/Data/UnityReferenceAssemblies/unity-4.8-api/*.dll. I guess the "solution" would be to download and place the .xml for each corresponding .dll in this directory...

    I don't really know what happened. Did I change the .NET API compatibility level somewhere? Did I change build platform (Mono, IL2CPP) or something? I don't know... (I started using the dynamic keyword which is a .NET 4.0 feature, which possibly upgraded my API Compatibility version to .Net Framework and I now target different dlls). But I shouldn't have to bother in the first place — documentation should be working by default, but we have to deal with unity here, so no surprise it's broken :)


    @Edit I got frustrated by this lack of basic functionality and I "fixed" it myself... Here is a tool all of you can use to make this semi-automatic: https://t3st3ro.github.io/packages/unityIntelliSenseFixer/

    It comes bundled with xmls that seem to work and a script that links them to automatic directories. Hit me up here or somewhere on my page if you have some improvements...