Currently using UI5 language assistant as default formatter for .xml files with these VSCode settings enabled.
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnPaste": true,
"editor.formatOnType": false, // required
"editor.formatOnSave": true, // optional
"editor.formatOnSaveMode": "file", // required to format on save
"files.autoSave": "onFocusChange", // optional but recommended
"editor.insertSpaces": true,
"editor.tabSize": 2,
"[xml]": {
"editor.defaultFormatter": "SAPOSS.vscode-ui5-language-assistant",
"editor.detectIndentation": false
},
"files.associations": {
"*.xml": "xml"
}
}
These are the prettier settings
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"arrowParens": "always",
"proseWrap": "never",
"htmlWhitespaceSensitivity": "strict",
"endOfLine": "lf"
}
The format result is that for most lines, spaces are used for indentation but it seems for lines of objects in quotes e.g. 'core:require' and 'items', tabs are used.
<mvc:View
controllerName="sap.vi.results.controller.Main"
displayBlock="true"
xmlns="sap.m"
xmlns:mvc="sap.ui.core.mvc"
xmlns:core="sap.ui.core"
xmlns:table="sap.ui.table"
core:require="{
formatter: 'sap/vi/results/model/formatter'
}"
>
<!-- Temporary table to view mock data -->
<Table
id="table"
inset="false"
items="{
path: '/InspectionResults',
sorter: {
path: 'id'
}
}"
>
...
Currently using UI5 language assistant as default formatter for
.xmlfiles with these VSCode settings enabled.{ "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.formatOnPaste": true, "editor.formatOnType": false, // required "editor.formatOnSave": true, // optional "editor.formatOnSaveMode": "file", // required to format on save "files.autoSave": "onFocusChange", // optional but recommended "editor.insertSpaces": true, "editor.tabSize": 2, "[xml]": { "editor.defaultFormatter": "SAPOSS.vscode-ui5-language-assistant", "editor.detectIndentation": false }, "files.associations": { "*.xml": "xml" } }These are the prettier settings
{ "printWidth": 80, "tabWidth": 2, "useTabs": false, "semi": true, "singleQuote": true, "trailingComma": "es5", "bracketSpacing": true, "arrowParens": "always", "proseWrap": "never", "htmlWhitespaceSensitivity": "strict", "endOfLine": "lf" }The format result is that for most lines, spaces are used for indentation but it seems for lines of objects in quotes e.g. 'core:require' and 'items', tabs are used.