XamlStyler
XamlStyler copied to clipboard
Settings.XamlStyler loaded with explicit path only
Hi there : )
Describe the bug
We have a Settings.XamlStyler
file sitting next to our *.sln
file. But it is not recognized, unless explicitly defined by its abolute path under "Rider" > "File" > "Settings" > "Tools" > "XAML Styler" > "Configuration" > "External configuration file:"
To Reproduce
- Create a new C# solution.
- Create a file
Settings.XamlStyler
next to the solution file - Fill it with content
- Open the solution
- Create a XAML file
- Alt+Enter > "Format with Xaml Styler"
- File is formatted, but with default settings, not the settings in the
Settings.XamlStyler
Expected behavior
-
Settings.XamlStyler
is detected automatically - XAML file is formatted according to the rules in the
Settings.XamlStyler
Workaround
- Entering the absolute path to
Settings.XamlStyler
at "Rider" > "File" > "Settings" > "Tools" > "XAML Styler" > "Configuration" > "External configuration file:"
External Configuration
{
"AttributesTolerance": 2,
"KeepFirstAttributeOnSameLine": true,
"MaxAttributeCharactersPerLine": 0,
"MaxAttributesPerLine": 1,
"NewlineExemptionElements": "RadialGradientBrush, GradientStop, LinearGradientBrush, ScaleTransfom,
SkewTransform, RotateTransform, TranslateTransform, Trigger, Condition, Setter", // Line break not in actual file
"SeparateByGroups": false,
"AttributeIndentation": 0,
"AttributeIndentationStyle": 1,
"RemoveDesignTimeReferences": false,
"EnableAttributeReordering": true,
"AttributeOrderingRuleGroups": [
"x:Class",
"xmlns, xmlns:x",
"xmlns:*",
"x:Key, Key, x:Name, Name, x:Uid, Uid, Title",
"Grid.Row, Grid.RowSpan, Grid.Column, Grid.ColumnSpan, Canvas.Left, Canvas.Top, Canvas.Right, Canvas.Bottom",
"Width, Height, MinWidth, MinHeight, MaxWidth, MaxHeight",
"Margin, Padding, HorizontalAlignment, VerticalAlignment, HorizontalContentAlignment,
VerticalContentAlignment, Panel.ZIndex", // Line break not in actual file
"*:*, *",
"PageSource, PageIndex, Offset, Color, TargetName, Property, Value, StartPoint, EndPoint",
"mc:Ignorable, d:IsDataSource, d:LayoutOverrides, d:IsStaticText",
"Storyboard.*, From, To, Duration"
],
"FirstLineAttributes": "",
"OrderAttributesByName": true,
"PutEndingBracketOnNewLine": false,
"RemoveEndingTagOfEmptyElement": true,
"SpaceBeforeClosingSlash": true,
"RootElementLineBreakRule": 0,
"ReorderVSM": 2,
"ReorderGridChildren": false,
"ReorderCanvasChildren": false,
"ReorderSetters": 0,
"FormatMarkupExtension": true,
"NoNewLineMarkupExtensions": "x:Bind, Binding",
"ThicknessSeparator": 2,
"ThicknessAttributes": "Margin, Padding, BorderThickness, ThumbnailClipMargin",
"FormatOnSave": false,
"CommentPadding": 2,
"IndentSize": 4
}
Version Info (please complete the following information):
- OS: Windows 10
- IDE: JetBrains Rider 2020.2.4
- XAML Styler: Plugin 3.2008.4.0 for JetBrains Rider
Thanks for having a look : )
Additional Information:
After manually setting the absolute path, this error cannot be reproduced anymore - even when removing it again.
Happens again after git clean
.
I do experience the same problem on Windows with VS 2022. Using .\Settings.XamlStyler
works as workaround.