RasmusTidselbak / al-var-helper

6 stars 7 forks source link

Sort Variables fails in comment in the VAR section #43

Open GreatScott000 opened 3 years ago

GreatScott000 commented 3 years ago

If you have a comment in the var section (local or global) the Sort Variable command fails. image

Either of these scenarios causes the above error.

var
     Customer: Record Customer;
     Customer2: Record Customer;
     //This is a comment 
     i: Integer;
     DimensionManagment: Codeunit DimensionManagement;

or

var
     Customer: Record Customer;
     Customer2: Record Customer;
     i: Integer;
     DimensionManagment: Codeunit DimensionManagement;

//This is a comment about the following procedure
procedure SomeProcedure() begin
end;
GreatScott000 commented 3 years ago

Also if there is an attribute on a procedure following the global variable declaration the error occurs:

var
     Customer: Record Customer;
     Customer2: Record Customer;
     i: Integer;
     DimensionManagment: Codeunit DimensionManagement;

[Scope('OnPrem')]
procedure SomeProcedure() begin
end;