Al: txt2al formatting <> VS Code AL autoformatting

Created on 15 Nov 2018  路  4Comments  路  Source: microsoft/AL

I noticed that the VS code autoformat feature (it seems to kick in when the AL language extension recognizes a change to a file that's been modified+saved) produces a format that, while harmless (i.e. adding spaces after semicolons, etc), it produces an .al file that results in possibly hundreds of diffs from the originating file that was outputted via the txt2al tool, thus adding unnecessary noise to my git workflow.

it would be nice if the AL Extension automatter and txt2al formatting were identical. Currently they are not.

al-format enhancement

Most helpful comment

And please add pair of brackets if missing:
INIT; => Init();

All 4 comments

+1, would also like if the keywords and calls to built-in functions would comply with the new conventions/standards (most of them will still be in ALLCAPS).

And please add pair of brackets if missing:
INIT; => Init();

I also noticed that the BC sandbox web client sandbox page designer does not format .al files in accordance to VS Code's AL auto-formatting (i.e. indendation different)

Starting with Spring 2019 CU3 the Txt2Al tool will automatically format the file using the same formatting engine as the AL compiler. I will create an item to track formatting the code generated by the designer.

For changes to the syntax that should be performed automatically, and which are not exclusively whitespace related, please open another issue.

Was this page helpful?
0 / 5 - 0 ratings