codefori / vscode-rpgle

RPGLE language tools for VS Code
MIT License
39 stars 20 forks source link

Semi colon on separate line casues indent linter warnings #237

Closed m-tyler closed 1 year ago

m-tyler commented 1 year ago

Updating to 0.20.0 I now receive linter warnings for code like this. Is there a new linter rule added for this in 0.20.0 that I need to set? This just an example of code that is longer that has this issue. I like to move the semi colon to its own line for some conditions where I might be adding additional later, it reduces my need to remove and add semi colons when adding additional conditions.

**FREE
If MyVar <> ThatValue  //<<-- move semi colon here and the warning go away.  There are no warnings for this code in v0.19.0
;
  DoThisCode();
Else;
  CoThatCOde();
Endif;
*INLR = *ON;
Return;

image

image

Example of in production code the new linter rules highlight. image

worksofliam commented 1 year ago

There was big change to the internals of the linter and I suspect this is clearly from that. I will look into this.

m-tyler commented 1 year ago

This code also causes linter warnings to appear but for something that does not seem correct. The semi colon on the SQL statement on a line by itself causes mp reference errors for the proc parameters.

**FREE
Dcl-S MyParm1 Char(1) Const;
Dcl-S MyParm2 Char(1) Const;
  exec sql 
        select 1 
        from MyTable
        Where MyField1 =:MyParm1 
        and MyField2 = :MyParm2
        ;
MyProc1();
*INLR = *ON;
Return;
dcl-proc MyProc1;
  dcl-pi *n ;
    pMyParm1 Char(1) Const;
    pMyParm2 Char(1) Const;
  end-pi;
  exec sql 
        select 1 
        from MyTable
        Where MyField1 =:pMyParm1 
        and MyField2 = :pMyParm2
        ; 
end-proc;

image

image

worksofliam commented 1 year ago

Whoops, you must have comments right as I made a release. Can you please share your rpglint.json config so I can recreate that?

worksofliam commented 1 year ago

Try out the 0.20.1 release and let me know how it goes. Thanks!

m-tyler commented 1 year ago

Updated to 0.20.1 and now that linter warning is not present. 😀😀 VERY NICE!!!.

image

Thanks!!!

P.S. Do you want another issue I have come across with the update to 0.20.1 in this issue or anew issue?

worksofliam commented 1 year ago

@m-tyler new issue please!! Thanks for everything!