microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
728 stars 241 forks source link

Region folding does not work when pragma is inside region and indentations are different #7602

Closed RadoArvay closed 6 months ago

RadoArvay commented 9 months ago

When the region is defined and there is a pragma inside it and indentations of them are different, then it is not possible to fold the region or neither pragma itself. There are no folding icons or they are misplaced:

image

If I match the indentations, the region folding works:

image image

But it is unable to fix it this way because "Format Document" command (manual or automatic during the save) updates indentations to initial state.

The behaviour is the same inside a code or inside an area like fields in table object...

Versions:

thpeder commented 6 months ago

Thanks for raising awareness of this issue. We will not have a solution for this in the near future, but in the next pre-release of the extension, you will be able to have Visual Studio Code to provide folding bases on their generic strategies, instead of getting them from the AL Language Extension.