Repository navigation
Add new splitAttributes values to package.json and Formatting docs #1176
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -391,7 +391,7 @@ | |
| "xml.format.preserveAttributeLineBreaks": { | ||
| "type": "boolean", | ||
| "default": true, | ||
| "markdownDescription": "Preserve line breaks that appear before and after attributes. This setting is overridden if `#xml.format.splitAttributes#` is set to `splitNewLine` or `alignWithFirstAttr`. Default is `true`. See [here](command:xml.open.docs?%5B%7B%22page%22%3A%22Formatting%22%2C%22section%22%3A%22xmlformatpreserveattributelinebreaks%22%7D%5D) for more information.", | ||
| "markdownDescription": "Preserve line breaks that appear before and after attributes. This setting is overridden if `#xml.format.splitAttributes#` is set to any mode except `preserve` or `preserve-aligned`. Default is `true`. See [here](command:xml.open.docs?%5B%7B%22page%22%3A%22Formatting%22%2C%22section%22%3A%22xmlformatpreserveattributelinebreaks%22%7D%5D) for more information.", | ||
| "scope": "window" | ||
| }, | ||
| "xml.format.preserveEmptyContent": { | ||
|
|
@@ -486,11 +486,28 @@ | |
| "type": "string", | ||
| "enum": [ | ||
| "preserve", | ||
| "auto", | ||
| "force", | ||
| "force-aligned", | ||
| "force-expand-multiline", | ||
| "aligned-multiple", | ||
| "preserve-aligned", | ||
|
Comment on lines
+489
to
+494
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: set -o pipefail
printf '%s\n' '--- package setting and dependency ---'
nl -ba package.json | sed -n '470,515p'
nl -ba package.json | sed -n '20,36p'
printf '%s\n' '--- splitAttributes references ---'
rg -n -F --glob '!node_modules/**' --glob '!dist/**' --glob '!build/**' -- 'splitAttributes' . || test "$?" -eq 1
printf '%s\n' '--- formatting configuration references ---'
rg -n -F --glob '!node_modules/**' --glob '!dist/**' --glob '!build/**' -- 'xml.format' src package.json | head -120 || test "$?" -eq 1Repository: redhat-developer/vscode-xml Length of output: 13926 🏁 Script executed: set -o pipefail
printf '%s\n' '--- settings owner and splitAttributes binding ---'
nl -ba src/settings/settings.ts | sed -n '150,235p'
rg -n -F --glob '*.ts' --glob '*.java' --glob '*.json' -- 'splitAttributes' src test tests || test "$?" -eq 1
printf '%s\n' '--- formatter settings consumers ---'
rg -n -F --glob '*.ts' --glob '*.java' --glob '*.json' -- 'FormattingOptions' src test tests || test "$?" -eq 1
rg -n -F --glob '*.ts' --glob '*.java' --glob '*.json' -- 'xml.format.splitAttributes' src test tests || test "$?" -eq 1Repository: redhat-developer/vscode-xml Length of output: 3975 🏁 Script executed: set -o pipefail
printf '%s\n' '--- getXMLSettings callers ---'
rg -n -F --glob '*.ts' -- 'getXMLSettings(' src || test "$?" -eq 1
printf '%s\n' '--- settings payload submission around callers ---'
for f in $(rg -l -F --glob '*.ts' -- 'getXMLSettings(' src); do
echo "--- $f"
nl -ba "$f" | sed -n '1,260p'
doneRepository: redhat-developer/vscode-xml Length of output: 27812 Do not expose the new modes before the backend supports them.
Update the marketplace backend to a release that implements these modes, or defer the enum and documentation changes until that release is available. 🤖 Prompt for AI Agents |
||
| "splitNewLine", | ||
| "alignWithFirstAttr" | ||
| ], | ||
| "markdownEnumDescriptions": [ | ||
| "Keep existing attribute layout. Attributes only wrap when `#xml.format.maxLineWidth#` is exceeded.", | ||
| "Wrap attributes when the line exceeds `#xml.format.maxLineWidth#`, using `#xml.format.splitAttributesIndentSize#` for indentation. Similar to `html.format.wrapAttributes: auto`.", | ||
| "Always wrap each attribute except the first onto its own line, using `#xml.format.splitAttributesIndentSize#` for indentation. Similar to `html.format.wrapAttributes: force`.", | ||
| "Always wrap each attribute except the first onto its own line, aligned with the first attribute. Similar to `html.format.wrapAttributes: force-aligned`.", | ||
| "Always wrap every attribute (including the first) onto its own line. Similar to `html.format.wrapAttributes: force-expand-multiline`.", | ||
| "Wrap attributes when the line exceeds `#xml.format.maxLineWidth#`, aligned with the first attribute. Similar to `html.format.wrapAttributes: aligned-multiple`.", | ||
| "Preserve existing line breaks, but align wrapped attributes with the first attribute. Similar to `html.format.wrapAttributes: preserve-aligned`.", | ||
| "**Deprecated** — use `force-expand-multiline` instead. Always wrap every attribute (including the first) onto its own line.", | ||
| "**Deprecated** — use `force-aligned` instead. Always wrap each attribute except the first, aligned with the first attribute." | ||
| ], | ||
| "default": "preserve", | ||
| "markdownDescription": "Split multiple attributes each onto a new line or align attributes to the first. Default is `preserve`. Indicate level of indentation with `#xml.format.splitAttributesIndentSize#`. See [here](command:xml.open.docs?%5B%7B%22page%22%3A%22Formatting%22%2C%22section%22%3A%22xmlformatsplitattributes%22%7D%5D) for more information.", | ||
| "markdownDescription": "Controls how attributes are wrapped across lines. Values follow the same naming convention as VS Code's `html.format.wrapAttributes` for consistency. Default is `preserve`. Indicate level of indentation with `#xml.format.splitAttributesIndentSize#`. See [here](command:xml.open.docs?%5B%7B%22page%22%3A%22Formatting%22%2C%22section%22%3A%22xmlformatsplitattributes%22%7D%5D) for more information.", | ||
| "scope": "window" | ||
| }, | ||
| "xml.format.splitAttributesIndentSize": { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: redhat-developer/vscode-xml
Length of output: 36304
🏁 Script executed:
Repository: redhat-developer/vscode-xml
Length of output: 25188
🏁 Script executed:
Repository: redhat-developer/vscode-xml
Length of output: 41980
🏁 Script executed:
Repository: redhat-developer/vscode-xml
Length of output: 28176
Document
preserve-alignedin themaxLineWidthbehavior.preserve-alignedpreserves existing breaks, but it also wraps on overflow and aligns new breaks with the first attribute.Suggested fix
🤖 Prompt for AI Agents