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

Rule "Remove space before commas and period" duplicates template comment in function module #348

Closed
ConjuringCoffee opened this issue Aug 22, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@ConjuringCoffee
Copy link
Contributor

Hi Jörg-Michael, the rule "Remove space before commas and period" causes a problem in function modules without parameters.

Example:

FUNCTION z_test.
  WRITE 'hello world'.
ENDFUNCTION.

When this function module is saved, a comment is automatically added by SAP standard:

FUNCTION Z_TEST
 " You can use the template 'functionModuleParameter' to add here the signature!
.

  WRITE 'hello world'.
ENDFUNCTION.

Ignoring the infuriating grammar issue in the comment, this is how it looks like after the ABAP Cleaner is executed:

FUNCTION z_test.
  " You can use the template 'functionModuleParameter' to add here the signature!

  WRITE 'hello world'.
ENDFUNCTION.

When saving again, the comment is added once again:

FUNCTION Z_TEST
 " You can use the template 'functionModuleParameter' to add here the signature!
.

  " You can use the template 'functionModuleParameter' to add here the signature!

  WRITE 'hello world'.
ENDFUNCTION.

This can be repeated indefinitely.

These are the options I used:
image

@jmgrassau
Copy link
Member

Hi ConjuringCoffee,

very nice finding indeed! (And yes, the grammar in this auto-generated comment is painful!)

Kind regards,
Jörg-Michael

@jmgrassau jmgrassau added the bug Something isn't working label Aug 22, 2024
@jmgrassau
Copy link
Member

Hi ConjuringCoffee,

I could reproduce this issue on Aug. 22nd, but it seems to me that in the meantime, this comment is not generated anymore when the function module is saved! Nevertheless, I changed the cleanup rule to skip this exact case:

image

Kind regards,
Jörg-Michael

@jmgrassau jmgrassau self-assigned this Sep 20, 2024
@ConjuringCoffee
Copy link
Contributor Author

Thanks!

I'm on the latest ADT version and the comment is still being generated for me. Maybe your ADT / your backend system is even more up-to-date 😉

@jmgrassau
Copy link
Member

Hi ConjuringCoffee,

thanks again for reporting this issue – this should now be fixed in version 1.19.3, which was just released!

And yes, maybe I did have an insight into some future ADT version here, who knows ;-)

Kind regards,
Jörg-Michael

@ConjuringCoffee
Copy link
Contributor Author

Great, thanks :)

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

No branches or pull requests

2 participants