Skip to content

Settings.XamlStyler loaded with explicit path only #308

@cz-dev-ge

Description

@cz-dev-ge

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 : )

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions