XamlStyler icon indicating copy to clipboard operation
XamlStyler copied to clipboard

"'FormatOnSave': true" doesn't work when global value is false

Open Denis535 opened this issue 4 years ago • 1 comments

If I disable global option FormatOnSave and enable local, then in the end it's disabled (enabled is expected). But if I enable global option and disable local then it's disabled (as expected).

It looks like global option is main. Is it by design?

External Configuration

{
    // Ordering/Elements
    "ReorderGridChildren": false,
    "ReorderCanvasChildren": false,
    "ReorderVSM": 2, // None, First, Last
    "ReorderSetters": 0, // None, Property, TargetName, TargetNameThenProperty 
    // Ordering/Attributes
    "EnableAttributeReordering": true,
    "FirstLineAttributes": "", // Keep on tag-line
    "AttributeOrderingRuleGroups": [
        "xmlns",
        "xmlns:x",
        "xmlns:d",
        "xmlns:mc",
        "xmlns:*",
        "xmlns:Controls",
        "xmlns:Views",
        "xmlns:ViewModels",
        "x:Class, x:Name, x:Key, x:Uid, x:*, Name, Key, Uid, Title, Header, Background, Foreground, Width, Height, MinWidth, MinHeight, MaxWidth, MaxHeight, Margin, Padding, *Alignment, RenderTransformOrigin, *, *.*",
        "d:*, mc:*, *:*"
    ],
    "OrderAttributesByName": true,

    // Spacing/Elements
    "SpaceBeforeClosingSlash": true,
    // Spacing/Attributes
    "AttributeIndentation": 0,
    "AttributeIndentationStyle": 1, // Mixed, Spaces 
    // Spacing/Comments
    "CommentPadding": 2,

    // MultiLining/Elements
    "PutEndingBracketOnNewLine": false,
    // MultiLining/Attributes
    "RootElementLineBreakRule": 1, // Default, Always, Never
    "AttributesTolerance": 0,
    "NewlineExemptionElements": "",
    "KeepFirstAttributeOnSameLine": true, // Start with tag-line
    "SeparateByGroups": true,
    "MaxAttributesPerLine": 0,
    "MaxAttributeCharactersPerLine": 0,

    // Special/Attributes/MarkupExtension
    "FormatMarkupExtension": false,
    "NoNewLineMarkupExtensions": "x:Bind, Binding",
    // Special/Attributes/Thickness
    "ThicknessAttributes": "Margin, Padding, BorderThickness, ThumbnailClipMargin",
    "ThicknessSeparator": 2,

    // Clearing/Elements
    "RemoveEndingTagOfEmptyElement": true,
    // Clearing/Attributes
    "RemoveDesignTimeReferences": false,

    // VSIX
    "FormatOnSave": true // true doesn't work when global value is false
}

Version Info:

  • OS: Windows 10 (1809)
  • Visual Studio: Enterprise 2019 Preview Version 16.6.0 Preview 2.1
  • XAML Styler: Extension (3.2003.9)

Denis535 avatar Apr 11 '20 22:04 Denis535

Similiar issue here, we have defined Settings.XamlStyler Files in some projects with FormatOnSave set to true, We only want to use the XamlStyler in those projects, in all other projects in the solution not. So we thought setting the global Format XAML on save to false would achieve that. But jokes on us, now the XAML Code is also not formatted on save in the projects with the custom Settings.XamlStyler files.

Is there already a solution for this issue?

hpirnstoetter avatar Apr 26 '23 07:04 hpirnstoetter