Open Mervill opened 2 months ago
insanely zased
xmldoc should probably be gitignored since it'll be regenerated anyway
xmldoc should probably be gitignored since it'll be regenerated anyway
Yes I was hoping someone would weigh in on this. If we want to do this we need a way to keep Resources\ViewVariables
from being deleted since the build script can't (yet?) create the folder if it does not exist.
Actually scratch that last, I can make msbuild create the folder apparently
There's now an command line program called XmlDocTool
that strips function information out of the docs since we wont ever use that data.
The number of excluded entries is pretty dramatic:
XmlDocTool - Robust.Shared: Total Nodes: 4864, Copied Nodes: 2157, Delta: -2707
XmlDocTool - Robust.Client: Total Nodes: 1583, Copied Nodes: 918, Delta: -665
XmlDocTool - Robust.Server: Total Nodes: 318, Copied Nodes: 122, Delta: -196
XmlDocTool - Content.Shared: Total Nodes: 14220, Copied Nodes: 5285, Delta: -8935
XmlDocTool - Content.Client: Total Nodes: 1771, Copied Nodes: 639, Delta: -1132
XmlDocTool - Content.Server: Total Nodes: 12097, Copied Nodes: 3475, Delta: -8622
Ok there are some minor pain points remaining (gui is a bit scuffed when the comments are big and long), but I think I'm ready for this to exit draft.
Overview
Adds code that can read the xml files generated by C# documentation comments and display those comments (currently the
<summary>
block) below types and variables inView Variables
windows.This PR doesn't (yet) actually toggle the xml doc file generation. You should add<GenerateDocumentationFile>True</GenerateDocumentationFile>
to the csproj of the project you want to generate docs for then copy the resulting xml file intoResources/ViewVariables
. You can use this to test this PR with the xml docs from content as well.I will do a content PR when this gets merged but to test you need to add:
to the Content
csproj
files to get them generating the doc files correctly.The xml docs are a little big, and they contain a bunch of info we're never going to use like function documentation. It wouldn't be to hard to have a script that discards unneeded entries to optimize the size of the resulting files.All the individual doc strings are loaded from the client resources folder, we don't send the doc strings over the network.
Since this info comes from the code (just like the type and variable names) we can't really expect to localize this text. That may be a deal-breaker.
TODO
<summary>
block breaking the doc string.<inheritdoc/>
but it might be in a follow-up PR.<GenerateDocumentationFile>
to the csproj files.Resources
folder cleanly. Right now it's only enabled for the Robust DLLS. If you want to test it locally you can add<ViewVariables>true</ViewVariables>
to the Content DLLS.You may need to an an emptyResources\ViewVariables\
folder for the build to work properly.<viewvariables>
block inside the xml comments that can add docs tailor-made for vv[ ] cleaner code[ ] (?) CVar config?[ ] (?) Improve the UI slightly to better accommodate the new doc strings