diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/StringSyntaxAttribute.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/StringSyntaxAttribute.cs index 26fcf5ca096408..66c5f9b3fc4f24 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/StringSyntaxAttribute.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/StringSyntaxAttribute.cs @@ -38,6 +38,9 @@ public StringSyntaxAttribute(string syntax, params object?[] arguments) /// The syntax identifier for strings containing composite formats for string formatting. public const string CompositeFormat = nameof(CompositeFormat); + /// The syntax identifier for strings containing C# code. + public const string CSharp = "C#"; + /// The syntax identifier for strings containing date format specifiers. public const string DateOnlyFormat = nameof(DateOnlyFormat); @@ -47,6 +50,9 @@ public StringSyntaxAttribute(string syntax, params object?[] arguments) /// The syntax identifier for strings containing format specifiers. public const string EnumFormat = nameof(EnumFormat); + /// The syntax identifier for strings containing F# code. + public const string FSharp = "F#"; + /// The syntax identifier for strings containing format specifiers. public const string GuidFormat = nameof(GuidFormat); @@ -68,6 +74,9 @@ public StringSyntaxAttribute(string syntax, params object?[] arguments) /// The syntax identifier for strings containing URIs. public const string Uri = nameof(Uri); + /// The syntax identifier for strings containing Visual Basic code. + public const string VisualBasic = "Visual Basic"; + /// The syntax identifier for strings containing XML. public const string Xml = nameof(Xml); } diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index ce6380fc645bf2..16fcc5f730823d 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -9096,9 +9096,11 @@ public SetsRequiredMembersAttribute() { } public sealed partial class StringSyntaxAttribute : System.Attribute { public const string CompositeFormat = "CompositeFormat"; + public const string CSharp = "C#"; public const string DateOnlyFormat = "DateOnlyFormat"; public const string DateTimeFormat = "DateTimeFormat"; public const string EnumFormat = "EnumFormat"; + public const string FSharp = "F#"; public const string GuidFormat = "GuidFormat"; public const string Json = "Json"; public const string NumericFormat = "NumericFormat"; @@ -9106,6 +9108,7 @@ public sealed partial class StringSyntaxAttribute : System.Attribute public const string TimeOnlyFormat = "TimeOnlyFormat"; public const string TimeSpanFormat = "TimeSpanFormat"; public const string Uri = "Uri"; + public const string VisualBasic = "Visual Basic"; public const string Xml = "Xml"; public StringSyntaxAttribute(string syntax) { } public StringSyntaxAttribute(string syntax, params object?[] arguments) { } diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Diagnostics/CodeAnalysis/StringSyntaxAttributeTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Diagnostics/CodeAnalysis/StringSyntaxAttributeTests.cs index ba53ab2c0f3bbe..251156cf037986 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Diagnostics/CodeAnalysis/StringSyntaxAttributeTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Diagnostics/CodeAnalysis/StringSyntaxAttributeTests.cs @@ -8,9 +8,12 @@ namespace System.Diagnostics.CodeAnalysis.Tests public sealed class StringSyntaxAttributeTests { [Theory] + [InlineData(StringSyntaxAttribute.CSharp)] [InlineData(StringSyntaxAttribute.DateTimeFormat)] + [InlineData(StringSyntaxAttribute.FSharp)] [InlineData(StringSyntaxAttribute.Json)] [InlineData(StringSyntaxAttribute.Regex)] + [InlineData(StringSyntaxAttribute.VisualBasic)] public void Ctor_Roundtrips(string syntax) { var attribute = new StringSyntaxAttribute(syntax);