0

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.

Tooster
  • 322
  • 3
  • 14
  • MSDN documentation is not a free thing and shipping it offline might require licensing from Microsoft, so I don't believe JetBrains is going to spend too much effort on that front. – Lex Li Jan 26 '22 at 23:42
  • Do you see inline documentation when you hover with the mouse over the WriteLine function? `Console.WriteLine("Hello World!");` – Rans Jan 26 '22 at 23:44
  • @Rans It also tries to redirect me to online resources with the hyperlink "`Console.WriteLine` on learn.microsoft.com". – Tooster Jan 27 '22 at 10:04
  • @LexLi that's not the case any more. There are no MSDN DVDs for at least a decade. – Panagiotis Kanavos Jan 27 '22 at 10:12
  • @Tooster there are no offline docs for at least a decade. They simply don't fit in a single DVD any more and worse, searching is **a lot slower**. What would you do if you had to index and search 4GB of docs? Would you let client apps just load the entire index in memory and search? How would Rider or any IDE behave if it had to handle so much data? Or would you install a search engine like eg Elastic with plenty of memory? – Panagiotis Kanavos Jan 27 '22 at 10:15
  • 1
    @Tooster that said, something's wrong in your installation. Tooltips come from the XML docs of an assembly, not learn.microsoft.com. VS Code or Rider should be able to display it. `my unity editor instance,` that may be the problem. Have you tried creating a simple .NET Core Console application instead? – Panagiotis Kanavos Jan 27 '22 at 10:18
  • @PanagiotisKanavos in the empty project the documentation looks fine -- first there is proper inline doc with parameters and whatnot, and only later there is the hiperlink: https://imgur.com/RbzqyO0 – Tooster Jan 27 '22 at 10:24
  • @Tooster I can't tell why this is the case with your Rider but by me, it shows an inline documentation (I'm on Windows). Maybe checking this Option might help: Settings | Editor | Code Editing --> Show quick documentation on hover – Rans Jan 27 '22 at 10:53
  • @Rans I already tried that, but there seems to be no effect when tweaking any options inside rider. Even funnier - plain new unity project created using unity 2021.2.8f1 is ALSO missing inline docs. I'll try reinstalling unity editor instance, but this time uncheck the "offline documentation", only tick linux and windows build support. – Tooster Jan 27 '22 at 11:07
  • 1
    @PanagiotisKanavos The names might change in the past few years (MSDN, VS Help, or whatever), but even in VS2022 the online/offline contents remain, https://learn.microsoft.com/en-us/visualstudio/help-viewer/installation?view=vs-2022 So "there are no offline docs for at least a decade" is not true. – Lex Li Jan 27 '22 at 17:37

1 Answers1

0

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...

Tooster
  • 322
  • 3
  • 14
  • 1
    If only such a small change is required, then Unity guys should be able to implement that with Microsoft's XML files from https://github.com/dotnet/dotnet-api-docs/tree/main/xml/FrameworksIndex, which are licensed under CC. However, like Josh Peterson commented in that Unity bug report, they are more focusing on migrating everything to .NET Core/.NET 6 which is of higher priority. When that's done, naturally they pull every bits from Microsoft's GitHub repos and the XML files should also be included. – Lex Li Jan 27 '22 at 17:49