Skip to content

Commit

Permalink
fix Bug: XML formatter does remove escape characters #407
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilja Postnovs authored and Ilja Postnovs committed Apr 14, 2024
1 parent cbb3e16 commit 97a984a
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
"--extensionDevelopmentPath=${workspaceFolder}",
"--disable-extensions"
],
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.18.1 (15-04-2024)

- [UI5 Linter](https://github.com/iljapostnovs/ui5plugin-linter) updated to v1.15.1
- Fixed XML formatter issue ([#407](https://github.com/iljapostnovs/VSCodeUI5Plugin/issues/407))

## 1.18.0 (06-02-2024)

- New preference entry introduced: `eventHandlerGenerationFormula`
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ui5plugin",
"displayName": "SAPUI5 Extension",
"description": "Extension for working with UI5 projects",
"version": "1.18.0",
"version": "1.18.1",
"publisher": "iljapostnovs",
"license": "Apache-2.0",
"author": "Ilja Postnovs <ilja.postnovs@gmail.com>",
Expand Down Expand Up @@ -545,7 +545,7 @@
"webpack-cli": "^5.1.4"
},
"dependencies": {
"ui5plugin-linter": "^1.15.0",
"ui5plugin-linter": "^1.15.1",
"ui5plugin-parser": "^1.7.7"
},
"__metadata": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,13 @@
>

</Button>
<DatePicker value="{
type: 'sap.ui.model.type.Date',
formatOptions: {
style: 'medium',
source: {
pattern: 'yyyy-MM-dd\'T\'hh:mm:ssXXX'
}
}
}" />
</c:FragmentDefinition>
2 changes: 1 addition & 1 deletion src/test/js/suite/data/XMLFormatterData.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"className": "com.extend.fragmenttest.view.fragments.FormatterTest",
"formattedText": "<c:FragmentDefinition\n\txmlns=\"sap.m\"\n\txmlns:c=\"sap.ui.core\"\n>\n\t<Text text=\"\\{type: 'sap.ui.model.type.Date', formatOptions: \\{UTC: true\\}, constraints: \\{\\} \\}\"/>\n\t<Button\n\t\tid=\"idButtonFragmentController2\"\n\t\ttext=\"{\n\t\t\tformatter: '.formatter.formatValueFragmentController2',\n\t\t\ttest: [1, 2, 3],\n\t\t\ttest2: ['abc', 'asd'],\n\t\t\ttest3: {\n\t\t\t\ttest: [1, 2, 3],\n\t\t\t\ttest2: ['abc', 'asd']\n\t\t\t},\n\t\t\ttest4: [{\n\t\t\t\tpath: 'asd'\n\t\t\t}, {\n\t\t\t\tpath: 123\n\t\t\t}]\n\t\t}\"\n\t\tpress=\"onButton11Press\"\n\t/>\n\t<Input value=\"{\n\t\tpath: '/',\n\t\ttype: 'sap.ui.model.type.String',\n\t\tconstraints: {\n\t\t\tsearch: '^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]{2,}\\\\.[a-zA-Z0-9-.]{2,}$'\n\t\t}\n\t}\"/>\n\t<Button text=\"{= ${/SupportModel}}\"/>\n\t<Button text=\"{Test}\"/>\n\t<Button\n\t\ticon=\"asd\"\n\t\ttext=\"{\n\t\t\tpath: 'test'\n\t\t}\"\n\t/>\n\t<Text\n\t\ttext=\"{\n\t\t\tpath: 'Test>Confidence',\n\t\t\ttype: 'sap.ui.model.type.Integer'\n\t\t} %\"\n\t\twrapping=\"false\"\n\t/>\n\t<Text\n\t\ttext=\"{\n\t\t\tpath: 'Test>Confidence',\n\t\t\ttype: 'sap.ui.model.type.Integer'\n\t\t} {\n\t\t\tpath: 'Test>Confidence',\n\t\t\ttype: 'sap.ui.model.type.Integer'\n\t\t}\"\n\t\twrapping=\"false\"\n\t/>\n\t<HBox\n\t\tjustifyContent=\"End\"\n\t\tvisible=\"{=\r\n\t\t\t${ZoneModel>ProcessingState} === '1' ||\r\n\t\t\t${ZoneModel>ProcessingState} === '6' ||\r\n\t\t\t${ZoneModel>ProcessingState} === '5'\r\n\t\t}\"\n\t/>\n\t<HBox visible=\"{=\r\n\t\t${device>/isDesktop} &amp;&amp;\r\n\t\t${\n\t\t\tpath: 'SupportModel>asd',\n\t\t\tformatter: '.documentStatusMapping.getPhInvGroupIsPostingAllowed'\n\t\t}\r\n\t}\"/>\n\t<Button visible=\"{=\r\n\t\t(\n\t\t\t(\r\n\t\t\t\t${TestModel>IS_SINGLE_PRODUCT_OFFER}\r\n\t\t\t) || (\r\n\t\t\t\t(\r\n\t\t\t\t\t${TestModel>LEVEL} === 'STORE_FORMAT_LEVEL' ||\r\n\t\t\t\t\t${TestModel>LEVEL} === 'PRODUCT_LEVEL'\r\n\t\t\t\t) &amp;&amp;\r\n\t\t\t\t!${TestModel>IS_SINGLE_PRODUCT_OFFER}\r\n\t\t\t)\n\t\t)\r\n\t}\"/>\n\t<Button visible=\"{=\r\n\t\t!(${SupportModel>/Layout})\n\t\t.startsWith('Three')\r\n\t}\"/>\n\t<Button\n\t\ttext=\"({TestModel>Test/Test})\"\n\t\ticon=\"({\n\t\t\tpath: 'TestModel>Test/Test',\n\t\t\tformatter: 'hello.Test'\n\t\t})\"\n\t\ttooltip=\"{=\r\n\t\t\tparseFloat(${TestModel>Test}) &gt; parseFloat(${TestModel>Test}) ?\r\n\t\t\t'random text (' + ${TestModel>Test} + ') random text (' + ${TestModel>Test} + ')' :\r\n\t\t\t''\r\n\t\t}\"\n\t/>\n</c:FragmentDefinition>"
"formattedText": "<c:FragmentDefinition\n\txmlns=\"sap.m\"\n\txmlns:c=\"sap.ui.core\"\n>\r\n\t<Text text=\"\\{type: 'sap.ui.model.type.Date', formatOptions: \\{UTC: true\\}, constraints: \\{\\} \\}\"/>\r\n\t<Button\n\t\tid=\"idButtonFragmentController2\"\n\t\ttext=\"{\n\t\t\tformatter: '.formatter.formatValueFragmentController2',\n\t\t\ttest: [1, 2, 3],\n\t\t\ttest2: ['abc', 'asd'],\n\t\t\ttest3: {\n\t\t\t\ttest: [1, 2, 3],\n\t\t\t\ttest2: ['abc', 'asd']\n\t\t\t},\n\t\t\ttest4: [{\n\t\t\t\tpath: 'asd'\n\t\t\t}, {\n\t\t\t\tpath: 123\n\t\t\t}]\n\t\t}\"\n\t\tpress=\"onButton11Press\"\n\t/>\r\n\t<Input value=\"{\n\t\tpath: '/',\n\t\ttype: 'sap.ui.model.type.String',\n\t\tconstraints: {\n\t\t\tsearch: '^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]{2,}\\\\.[a-zA-Z0-9-.]{2,}$'\n\t\t}\n\t}\"/>\r\n\t<Button text=\"{= ${/SupportModel}}\"/>\r\n\t<Button text=\"{Test}\"/>\r\n\t<Button\n\t\ticon=\"asd\"\n\t\ttext=\"{\n\t\t\tpath: 'test'\n\t\t}\"\n\t/>\r\n\t<Text\n\t\ttext=\"{\n\t\t\tpath: 'Test>Confidence',\n\t\t\ttype: 'sap.ui.model.type.Integer'\n\t\t} %\"\n\t\twrapping=\"false\"\n\t/>\r\n\t<Text\n\t\ttext=\"{\n\t\t\tpath: 'Test>Confidence',\n\t\t\ttype: 'sap.ui.model.type.Integer'\n\t\t} {\n\t\t\tpath: 'Test>Confidence',\n\t\t\ttype: 'sap.ui.model.type.Integer'\n\t\t}\"\n\t\twrapping=\"false\"\n\t/>\r\n\t<HBox\n\t\tjustifyContent=\"End\"\n\t\tvisible=\"{=\r\n\t\t\t${ZoneModel>ProcessingState} === '1' ||\r\n\t\t\t${ZoneModel>ProcessingState} === '6' ||\r\n\t\t\t${ZoneModel>ProcessingState} === '5'\r\n\t\t}\"\n\t/>\r\n\t<HBox visible=\"{=\r\n\t\t${device>/isDesktop} &amp;&amp;\r\n\t\t${\n\t\t\tpath: 'SupportModel>asd',\n\t\t\tformatter: '.documentStatusMapping.getPhInvGroupIsPostingAllowed'\n\t\t}\r\n\t}\"/>\r\n\t<Button visible=\"{=\r\n\t\t(\n\t\t\t(\r\n\t\t\t\t${TestModel>IS_SINGLE_PRODUCT_OFFER}\r\n\t\t\t) || (\r\n\t\t\t\t(\r\n\t\t\t\t\t${TestModel>LEVEL} === 'STORE_FORMAT_LEVEL' ||\r\n\t\t\t\t\t${TestModel>LEVEL} === 'PRODUCT_LEVEL'\r\n\t\t\t\t) &amp;&amp;\r\n\t\t\t\t!${TestModel>IS_SINGLE_PRODUCT_OFFER}\r\n\t\t\t)\n\t\t)\r\n\t}\"/>\r\n\t<Button visible=\"{=\r\n\t\t!(${SupportModel>/Layout})\n\t\t.startsWith('Three')\r\n\t}\"/>\r\n\t<Button\n\t\ttext=\"({TestModel>Test/Test})\"\n\t\ticon=\"({\n\t\t\tpath: 'TestModel>Test/Test',\n\t\t\tformatter: 'hello.Test'\n\t\t})\"\n\t\ttooltip=\"{=\r\n\t\t\tparseFloat(${TestModel>Test}) &gt; parseFloat(${TestModel>Test}) ?\r\n\t\t\t'random text (' + ${TestModel>Test} + ') random text (' + ${TestModel>Test} + ')' :\r\n\t\t\t''\r\n\t\t}\"\n\t/>\r\n\t<DatePicker value=\"{\n\t\ttype: 'sap.ui.model.type.Date',\n\t\tformatOptions: {\n\t\t\tstyle: 'medium',\n\t\t\tsource: {\n\t\t\t\tpattern: 'yyyy-MM-dd\\'T\\'hh:mm:ssXXX'\n\t\t\t}\n\t\t}\n\t}\"/>\r\n</c:FragmentDefinition>"
}
]
}

0 comments on commit 97a984a

Please sign in to comment.