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

Formatting: "xml.format.splitAttributes" mixes orthogonal configurations #984

Open
l-inc opened this issue Apr 8, 2024 · 0 comments
Open

Comments

@l-inc
Copy link

l-inc commented Apr 8, 2024

The current pre-release version (after v0.26.1) changes how "xml.format.splitAttributes" is configured. In my opinion, it now mixes 3 orthogonal configurations:

  • Whether to split the attributes. Possible options:
    -- Preserve as is (but obey "xml.format.maxLineWidth")
    -- Force split 1 per line
    -- Force join (but obey "xml.format.maxLineWidth")
    -- Force join if all attributes fit within "xml.format.maxLineWidth", otherwise force split 1 per line
  • How to align the attributes. Possible options:
    -- Preserve as is
    -- Align with the first attribute (or with the element ending if no attribute on the first line)
    -- Apply 1, 2, 3 etc. indentations
  • Whether to start the first attribute on a new line. Possible options:
    -- Preserve as is (but obey "xml.format.maxLineWidth")
    -- Force same line as element (but obey "xml.format.maxLineWidth")
    -- Force new line
    -- Force same line if all attributes fit within "xml.format.maxLineWidth". Otherwise, force new line.

All possible choices for these 3 configurations are meaningfully combinable. Whereas the current mix within "xml.format.splitAttributes" leads to unwanted side-effects. E.g., the indentation is forced to 1 (regardless of "xml.format.splitAttributesIndentSize") if "xml.format.splitAttributes" is set to "preserve".

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

No branches or pull requests

1 participant