Closed Aquato closed 6 months ago
Can you share an example project where you see this issue so that it can be easily repro-ed?
I tested a little further. The problem doesn't seem to occur in smaller files. I wanted to create an example for you with just a few lines. The problem didn't exist there. I looked into smaller "old" files and the problem wasn't present there either. However, the problem arises in every larger file with 1000 or more lines, and correspondingly several regions. Unfortunately I cannot send you any of these projects. The German GDPR prohibits me from doing this. I'm trying to create a sample project large enough that this problem occurs.
The German GDPR prohibits me from doing this.
The GDPR just protects personal data of natural persons, so you can just remove or anonymize the personal information from the source code. (I would even consider this a bad practice to store personal information inside source code.) Or maybe you just meant that your company doesn't allow code sharing.
Excuse me. Yes, I meant code sharing. I'm still working on an example project for you.
I think I found the problem. A region within a region is probably not possible. Because that creates the problem.
The code below causes the problem as soon as you add more lines. If you remove region 2.2 the problem doesn't occur.
codeunit 99555 Test
{
#region Test 1
procedure Test1()
var
begin
end;
#endregion Test 1
#region Test2
procedure Test2()
var
begin
#region Test2.2
#endregion Test2.2
end;
#endregion Test2
#region Test 3
procedure Test3()
var
begin
end;
#endregion Test 3
#region Test4
procedure Test4()
var
begin
end;
#endregion Test4
#region Test5
procedure Test5()
var
begin
//Test
end;
#endregion Test5
#region Test6
procedure Test6()
var
begin
end;
#endregion Test6
}
Thanks for the repro steps!
Hello, Unfortunately, I have had the following problem since the first update to version 11. As soon as I add new code, comments or anything else, the regions stop working. You can still fold these but not where the arrow is. The screen area also looks as if everything is marked. If I remove the adjustment again, or save everything and restart Visual Studio, everything works again. Until I add or delete some lines again. So I have to work on the latest version 10 all the time. I've already tried this in a completely new file with 5 lines of code. Always the same.
Version 10:
https://github.com/microsoft/AL/assets/53939875/d54b3358-3fec-4a0a-a559-f1b79768f15b
Version 12 (As in version 11):
https://github.com/microsoft/AL/assets/53939875/e50efb75-19dd-48ca-a5df-e8048c7785a1
I was able to replicate the problem with other colleagues. However, they don't work with regions and so they hadn't noticed this before.