ui5-migration icon indicating copy to clipboard operation
ui5-migration copied to clipboard

Tooling sometimes breaks the source formatting

Open codeworrior opened this issue 5 years ago • 0 comments

While working on https://github.com/SAP/openui5/commit/c782ce9be8cbd71201e19ba3cb4c0e81e439b71f , I encountered the following issue with the ui5-migration tooling:

The migration tooling sometimes breaks the source formatting, especially the indent of closing brackets. This might be a follow-up issue of #29, but I think I encountered it more often than #29.

Before

					...
					if (selectedItem == subItem) {
						popupSelectedItem = popupSubItem;
					}
				}

			}

			var newGroup = new NavigationListItem({
				expanded: true,
			...

After (note the curly braces which have moved, as has the follow-up statement)

					...
					if (selectedItem == subItem) {
						popupSelectedItem = popupSubItem;
				}

			}

			

		}

		var newGroup = new NavigationListItem({
				expanded: true,
		...

To reproduce, you can execute the following commands

cd openui5
git checkout 6555a38
ui5-migration migrate src/sap.tnt/src/sap/tnt/NavigationListItem.js

codeworrior avatar Jul 15 '19 22:07 codeworrior