Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
SSaulenas opened this issue Sep 2, 2024 · 2 comments · May be fixed by #348
Open

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

SSaulenas opened this issue Sep 2, 2024 · 2 comments · May be fixed by #348
Assignees
Labels
bug Something isn't working

Comments

@SSaulenas
Copy link
Collaborator

SSaulenas commented Sep 2, 2024

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.
@SSaulenas SSaulenas added the bug Something isn't working label Sep 2, 2024
@gustason gustason self-assigned this Sep 3, 2024
@eglekaz
Copy link
Collaborator

eglekaz commented Sep 26, 2024

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

@PauliusJaskutelis
Copy link
Collaborator

Still ongoing, when CRLF end of line sequence is selected and there is a single line comment, removing the line comment or changing to LF eol sequence the issue disappears.

class Class final:

    //// comment
    
    method public void something(ttSomething):
     
        define buffer bSomething for Something.
          
        for each ttSomething:
      
            create bSomething.
        end.
      
    end method.

end class.

Becomes:

class Class final:

    //// comment
    
    method public void something( ttSomething):
     
        define buffer bSomething for Something.
        
      for each ttSomething:
        
              create bSomething.
          end.
        
    end method.

end class.

Trying on this code it doesn't break the method name anymore:

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.

@PauliusKu PauliusKu linked a pull request Mar 6, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants