Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings.XamlStyler loaded with explicit path only #308

Closed
cd-dev-ge opened this issue Nov 9, 2020 · 3 comments · Fixed by #401
Closed

Settings.XamlStyler loaded with explicit path only #308

cd-dev-ge opened this issue Nov 9, 2020 · 3 comments · Fixed by #401

Comments

@cd-dev-ge
Copy link

cd-dev-ge commented Nov 9, 2020

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

@cd-dev-ge
Copy link
Author

Additional Information:

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

@cd-dev-ge
Copy link
Author

Happens again after git clean.

@Prodigio
Copy link

Prodigio commented Feb 6, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants