Skip to content

Add StringSyntax(CompositeFormat) to format string parameters - #154

Open
armadavalor wants to merge 1 commit into
Cysharp:masterfrom
armadavalor:feat/string-syntax-139
Open

armadavalor wants to merge 1 commit into
Cysharp:masterfrom
armadavalor:feat/string-syntax-139

Conversation

@armadavalor

Copy link
Copy Markdown

Marks the composite format string parameter of AppendFormat, ZString.Format, Utf8Format, PrepareUtf16/PrepareUtf8, the Utf16PreparedFormat/Utf8PreparedFormat constructors and TextMeshPro SetTextFormat with [StringSyntax(StringSyntaxAttribute.CompositeFormat)] so IDEs can highlight and validate format strings.

StringSyntaxAttribute is built in only on .NET 7+, so an internal polyfill (#if !NET7_0_OR_GREATER) covers netstandard2.0/2.1, net6.0 and the Unity copy. Both the .tt templates and the generated .cs files (including the Unity copy) are updated.

Closes #139

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add string syntax attribute to .AppendFormat()

1 participant