Rider Structural Search & Replace Configuration Generator
Generate DotSettings XML for Rider/ReSharper Structural Search and Replace patterns. Output XML to the chat — never modify project files.
Workflow
- •Gather pattern details from the user (search pattern, optional replace pattern, placeholders, options).
- •Generate a GUID for the pattern (uppercase hex, 32 chars, no hyphens).
- •Build the XML lines following the schema in references/schema.md.
- •Present the XML in a fenced code block with guidance on where to paste it.
Gathering Input
Ask for or infer from context:
- •Search pattern (required): C# code with
$name$placeholders. Example:$args$.State = $value$; - •Replace pattern (optional): if provided, generates a replace pattern. Example:
$args$.SetState($value$); - •Placeholders: for each
$name$in the patterns, determine the type and properties. See references/schema.md for all placeholder types. - •Options (all optional, have defaults):
- •
Severity: ERROR (default), WARNING, SUGGESTION, HINT, DO_NOT_SHOW - •
Comment/ReplaceComment: description shown in the inspection list - •
SuppressionKey: custom key for// ReSharper disablecomments - •
FormatAfterReplace: default False - •
ShortenReferences: default False (omitted when default) - •
MatchCatchClauseWithoutExceptionFilter: default False - •
LanguageName: CSHARP (default), VBASIC, or others
- •
Generating the XML
Read references/schema.md for the full XML schema, placeholder types, property details, and encoding rules.
Key rules:
- •Generate a random 32-character uppercase hex GUID (no hyphens) for each pattern.
- •XML-encode
<as<,>as>,&as&in SearchPattern, ReplacePattern, and placeholder property values. - •Only emit
IsReplacePattern,ReplacePattern,FormatAfterReplace,ShortenReferences, andMatchCatchClauseWithoutExceptionFilterwhen a replace pattern is provided. - •Always emit
@KeyIndexDefinedas the first line. - •Emit placeholder lines grouped per placeholder, after all pattern-level lines.
- •For search-only patterns (no replace), emit:
@KeyIndexDefined,Comment(if provided),LanguageName,SearchPattern,Severity, and placeholder blocks.
Output Format
Present the XML inside a fenced XML code block. Add a brief note:
Paste this XML into your
.DotSettingsfile (team-shared or personal) inside the root<wpf:ResourceDictionary>element, alongside otherPatternsAndTemplates/StructuralSearchentries.