redhat-developer / redhat-developer/vscode-xml

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

Open
#984 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

formatting
Dominant language
TypeScript
Stars
328
Forks
101
Avg merge
1d 17h
Merged PRs (30d)
7

Description

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".

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by locating the handling of xml.format.splitAttributes, xml.format.splitAttributesIndentSize, and xml.format.maxLineWidth; done would require independently configurable attribute splitting, alignment, and first-attribute line placement, with their combinations behaving consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.