Some doc comments for type abbreviations.

This commit is contained in:
Pieter-Jan Briers
2020-01-05 15:42:20 +01:00
parent 131a1ee3bd
commit 7d8992e0ca
2 changed files with 15 additions and 0 deletions
@@ -5,6 +5,9 @@ using YamlDotNet.RepresentationModel;
namespace Robust.Shared.Utility
{
/// <summary>
/// Utility class for abbreviating common type names.
/// </summary>
public static class TypeAbbreviation
{
private static readonly Abbreviation[] _abbreviations;
@@ -26,6 +29,11 @@ namespace Robust.Shared.Utility
_abbreviations = ParseAbbreviations((YamlSequenceNode) document.RootNode);
}
/// <summary>
/// Attempt to abbreviate a full type name into something shorter.
/// </summary>
/// <param name="name">The type name to abbreviate.</param>
/// <returns>A shorter, but still unique, version of the passed type name.</returns>
public static string Abbreviate(ReadOnlySpan<char> name)
{
var sb = new StringBuilder();
@@ -1,3 +1,10 @@
# Config file for the abbreviations system (TypeAbbreviations.cs).
# Format should be pretty self explanatory.
# Each abbreviation has a long, a short and (optionally) a list of sub abbreviations.
# The sub abbreviations get tried if their owner passed.
# Only one abbreviation can pass in a set of abbreviations
# (and then that passing one's sub abbreviations get considered).
- long: "System"
short: "S"
sub: