BartPermentier / al-toolbox

Adds Features to the AL Language Extension
MIT License
13 stars 9 forks source link

Don't create regions when they already exists (even if they don't match the location you want) #107

Closed weha closed 11 months ago

weha commented 1 year ago

If regions already exist for a function, they should not be automatically created again.

codeunit 123456 "ESCATest"
{
    Access = Public;
    SingleInstance = true;

    #region TestFunction
    [IntegrationEvent(false, false)]
    internal procedure TestFunction()
    begin
    end;
    #endregion TestFunction
}

Then execute create regions will create extra regions. The location for either is probably debatable but creating secondary regions should not happen.

codeunit 123456 "ESCATest"
{
    Access = Public;
    SingleInstance = true;

    #region TestFunction
    [IntegrationEvent(false, false)]
    #region TestFunction
    internal procedure TestFunction()
    begin
    end;
    #endregion TestFunction
    #endregion TestFunction
}
fvet commented 1 year ago

Regions2

dsaveyn commented 1 year ago

We are testing a fix for this internally as we speak.

dsaveyn commented 11 months ago

The fix for this will be included in the upcoming 2.0.29 release.