Skip to content

CLI produces different output than VS2022 extension (same version, same settings) #565

Description

@DavidHollman

Version: 3.2501.8 (both CLI dotnet tool and VS2022 extension)
Settings: External configuration file with MaxAttributesPerLine: 1, AttributesTolerance: 0, KeepFirstAttributeOnSameLine: false, PutEndingBracketOnNewLine: true

The CLI (xstyler -f <file> -c settings.json) produces different output than the VS2022 extension "Format on Save" given identical settings file and identical input.

Repro 1: Markup extension wrapping

Input:

Title="{Binding WindowName, StringFormat='Window Properties - [{0}]'}"

CLI output: unchanged (left on one line)

VS plugin output:

Title="{Binding WindowName,
                StringFormat='Window Properties - [{0}]'}"

Repro 2: Setter/Trigger attribute expansion

Input:

<Setter Property="Padding" Value="2" />
<Trigger Property="IsEnabled" Value="False">

CLI output: unchanged (left on one line)

VS plugin output:

<Setter
    Property="Padding"
    Value="2"
    />
<Trigger
    Property="IsEnabled"
    Value="False"
    >

So running the CLI on the VS-formatted output produces no changes for those cases.

Settings excerpt

{
    "AttributesTolerance": 0,
    "MaxAttributesPerLine": 1,
    "KeepFirstAttributeOnSameLine": false,
    "PutEndingBracketOnNewLine": true,
    "SpaceBeforeClosingSlash": false,
    "EnableAttributeReordering": false,
    "FormatMarkupExtension": true
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions