Add [StringSyntax] attribute to RegExMatch (#3214)#4827
Merged
Conversation
…ghting Annotate RegExMatch.Expression property and all constructor expression parameters with [StringSyntax(Regex)] so IDEs provide syntax highlighting and validation for regex string literals. Add reflection test verifying the attributes are present, and a generator test confirming user-applied attributes on partial properties compile correctly. Fix flaky async rule exception tests by replacing timing-based assertions with TCS signaling. Co-Authored-By: Claude Opus 4.6 <[email protected]>
3278900 to
a326928
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RegExMatch.Expressionproperty and all constructorexpressionparameters with[StringSyntax(StringSyntaxAttribute.Regex)]so IDEs provide regex syntax highlighting and validation within string literals[StringSyntax]attributes are present on the property and all constructor parametersCase10) confirming user-applied attributes (e.g.,[Description],[StringSyntax]) on partial properties compile correctly with the[CslaImplementProperties]generatorAsyncRuleExceptiontests by replacing timing-based assertions withTaskCompletionSourcesignaling and increasingWaitAsynctimeout from 150ms to 5sCloses #3214
Test plan
RegExMatchHasStringSyntaxAttribute— verifies via reflection that[StringSyntax(Regex)]is on theExpressionproperty and all 3 constructorexpressionparametersCase10— verifies partial properties with user-applied attributes compile without duplicate attribute errorsAsyncRuleException_Testcase01/Testcase02— no longer flaky on CI🤖 Generated with Claude Code