BalticAmadeus / AblFormatter

Code formatter for Progress OpenEdge (ABL)
Apache License 2.0
5 stars 0 forks source link

Comments disrupt the formatting then End of line is selected to CRLF #153

Open SSaulenas opened 1 month ago

SSaulenas commented 1 month ago

Example, this:

    //// comment

    method public void something(ttSomething):

        define buffer bSomething for Something.

        for each ttSomething:

            create bSomething.
        end.

    end method.

Becomes this:

    //// comment

    method public void something(ttSomething):

        define buffer bSomething for Something.

      for each ttSomething:

              create bSomething.
          end.

    end method.

This formatting issue occurs when the line ending is not set to LF (Line Feed). When set to LF, the formatting works correctly.

Also then comment is in this format /**/ formatting works correctly: Example:

class Class final:

    /*comment*/
    method public void something(ttSomething):

        define buffer bSomething for Something.

        if a < b or a > b then do:
            message "not equals".
        end.
        else do:
            do while a < 100:
                if a = b then message "equals".
                else message "error".
            end.
        end.                                                                                                                 
    end method.

end class.
eglekaz commented 3 weeks ago

This:

class MyUtility:
  // used when two or more of same processes are not supposed to be executing at the same time
  method public log alreadyRequestedProcess(pcProgramName as char):
    return false.
  end method.
end class.

Becomes this:

class MyUtility:
  // used when two or more of same processes are not supposed to be executing at the same time
  method public log alreadyRequestedPr:
cess(pcProgramName as char):
     return false.
   end method.
end class.

If the comment is removed, the issue is gone