XamlStyler icon indicating copy to clipboard operation
XamlStyler copied to clipboard

Settings.XamlStyler loaded with explicit path only

Open georg-eckert-zeiss opened this issue 3 years ago • 2 comments

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

  1. Create a new C# solution.
  2. Create a file Settings.XamlStyler next to the solution file
  3. Fill it with content
  4. Open the solution
  5. Create a XAML file
  6. Alt+Enter > "Format with Xaml Styler"
  7. 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 : )

georg-eckert-zeiss avatar Nov 09 '20 12:11 georg-eckert-zeiss

Additional Information:

After manually setting the absolute path, this error cannot be reproduced anymore - even when removing it again.

georg-eckert-zeiss avatar Nov 10 '20 16:11 georg-eckert-zeiss

Happens again after git clean.

georg-eckert-zeiss avatar Nov 27 '20 16:11 georg-eckert-zeiss

I do experience the same problem on Windows with VS 2022. Using .\Settings.XamlStyler works as workaround.

Prodigio avatar Feb 06 '23 07:02 Prodigio