Skip to content

Commit 2a0c7c3

Browse files
authored
feat(generators): add string constant for top-level VSCT GUIDs (#7)
Top-level GUIDs (those without IDSymbols) now generate both a string constant and a Guid field, consistent with command set GUIDs.
1 parent 67bfa36 commit 2a0c7c3

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/CodingWithCalvin.VsixSdk.Generators/VsctGuidsGenerator.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,10 @@ private static string GenerateSource(string rootNamespace, string className, str
160160
{
161161
if (guidSymbol.IdSymbols.Count == 0)
162162
{
163-
// Simple GUID constant
163+
// Simple GUID constant with both string and Guid versions
164164
sb.AppendLine($" /// <summary>GUID: {{{guidSymbol.Value}}}</summary>");
165-
sb.AppendLine($" public static readonly Guid {guidSymbol.Name} = new Guid(\"{guidSymbol.Value}\");");
165+
sb.AppendLine($" public const string {guidSymbol.Name}String = \"{guidSymbol.Value}\";");
166+
sb.AppendLine($" public static readonly Guid {guidSymbol.Name} = new Guid({guidSymbol.Name}String);");
166167
sb.AppendLine();
167168
}
168169
else

0 commit comments

Comments
 (0)