public sealed class StringFamilyA set of strings whose ids share a prefix and whose keys the code already has.
Remarks
The shape a declaration class had no way to express. A StringId property declares one string; a mode that registers a command per tool, per digit or per debug flag has a family of them, and until this existed the only way to write one was at the call site — new StringId("editor.command." + id, label). That reads fine and is a hole: the id exists only at run time, so it is in no All list, so Template does not export it, so no translator's template contains it and translating that half of a toolset is impossible.
⚠ And it was invisible to the gate written to find exactly that. ./build.sh CheckStrings needs a string literal where the id goes, so a concatenation was never in its census — which is why the census could report a ceiling of zero while the ids that genuinely could not be declared were the ones it could not see. The census counts constructions now, and this is the shape that lets a family stop being one.
What a call site does with it is index it by the key it already has — a command id, a tool name, a slot number — and pass the answer where it used to pass a construction. The family's All goes into the declaration class's All list with a spread, so every member reaches a translator the same way a single declaration does.
⚠ Item throws rather than inventing a string. A key no member covers is a command whose label was never declared; answering with the key would put a dotted id on a menu and answering with an empty string would put nothing there, and both are the quiet failure this type exists to end. It is thrown while a mode registers its commands, which is deterministic and covered by that mode's own tests.
Fields and properties (3)
Methods (2)
public StringFamily(string prefix, IEnumerable<KeyValuePair<string, string>> members)Declares a family.
public bool Covers(string key)Whether it has a member.
Used by (7)
- StringFamilyTestsVixen.Ui.Tests
- BlockoutStringsVixen.Editor.Blockout
- DiagnosticsStringsVixen.Editor.Diagnostics
- EditorStringsVixen.Editor.Ui
- TerrainStringsVixen.Editor.Terrain
- TexturingStringsVixen.Editor.Texturing
- WaterStringsVixen.Editor.Water