You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Question: Clean-Up Interactive Mode without changing the class? #114
Hello,
while I introduced this great functionality to some colleagues, I noticed that even when trying to jump into interactive mode I'm already changing the class, therefore I must be added to the transport request. We want to use the cleaner in Code Reviews, so I would like to see how much the cleaner finds, but in a "read only" mode if that makes sense?
What do you think?
that's indeed a good point – ABAP cleaner starts a "rewrite session" when opening the interactive cleanup, which prevents other people from changing the object in the meantime.
A "read only" mode would also be beneficial when looking at legacy code (or any code in non-development systems) which you can't or won't change at that moment: With the cleanup rules applied, the code might simply be easier to read and understand.
So, yes, very nice idea – I'd only hesitate a bit about adding another menu item (and shortcut?) for it.
For the time being, a quick workaround would be to install the stand-alone version in parallel: You can paste any amount of ABAP code into that just via clipboard, as long as blocks like IF ... ENDIF are complete (see usage). Both the stand-alone version and the ADT plug-in share the same profile settings etc., which are saved on the local machine.
This is a good idea. I've often wanted to do something similar, to check whether another developer has run the cleanup.
That would be a cool feature too. The code pal would insert a line at the beginning with a checksum or something and an ATC check can check if the comment exists and the checksum is correct
that's indeed a good point – ABAP cleaner starts a "rewrite session" when opening the interactive cleanup, which prevents other people from changing the object in the meantime.
A "read only" mode would also be beneficial when looking at legacy code (or any code in non-development systems) which you can't or won't change at that moment: With the cleanup rules applied, the code might simply be easier to read and understand.
So, yes, very nice idea – I'd only hesitate a bit about adding another menu item (and shortcut?) for it.
For the time being, a quick workaround would be to install the stand-alone version in parallel: You can paste any amount of ABAP code into that just via clipboard, as long as blocks like IF ... ENDIF are complete (see usage). Both the stand-alone version and the ADT plug-in share the same profile settings etc., which are saved on the local machine.
Kind regards, Jörg-Michael
Haven't thought of the standalone version, thank you! I guess you can't tell if the class is already locked (in that case the edit mode would be fine) or if the class is in read only mode (which it is in Eclipse until you change something)
with the next ABAP cleaner release, there will now be a third menu item (hope the menu text + shortcut are intuitive?)
This opens the interactive window without locking the object, so you can also call it if someone else locked the object, or you don't have a transport, or you're in the wrong client, or you don't even have development authorization in the system.
Inside the ABAP cleaner UI, everything is exactly the same, except that you don't have the "Apply and Close" button and menu, but instead, you only have
and
So whatever you do inside the ABAP cleaner UI, the code in the ADT editor will not be affected. You can nevertheless change ABAP cleaner configuration (selected profile, restriction to ABAP release, activation of rules, rule options etc.) just as you would in the interactive cleanup, and these changes are kept.
Another small improvement is that the window title now also shows the ABAP release of the system in which the code editor was opened:
P.S.: If you have better suggestions for "Preview as Read-Only With ABAP Cleaner…", please let me know. "Show Read-Only Preview of Cleanup With ABAP Cleaner…" would be more precise, but that would be a bit long. I also considered "Preview (Read-Only) With ABAP Cleaner…", but the parentheses look a bit awkward in the menu.
Regarding the shortcut, Ctrl+5 would probably also be available, but since this opens the UI, I felt that it is better to have a shortcut that is similar to Ctrl+Shift+4. Anyway, everybody could configure this as needed – and I know, on certain macOS releases, both Ctrl+Shift+4 and Ctrl+Shift+5 are reserved by the system for screenshot(?) functionality.
Hi Jörg-Michael,
that is awesome, thank you! For the text I think just "Preview with ABAP Cleaner" is enough, but yours works too for sure. I agree with the shortcut, it should be Ctrl+Shift and the 5 just makes sense
thanks a lot! I actually changed the menu text again to "Show Read-Only Preview With ABAP Cleaner…", because I felt "Preview as Read-Only" sounded a bit awkward (but I'm obviously not a native speaker).
Anyway, I somehow wanted to have "Read-Only" in the text in order to point out the difference to the interactive cleanup – which could of course also be used as a preview, if you close it with "Cancel".
Release process is on its way now, so this will be available very soon :-)
Activity
jelliottp commentedon Sep 26, 2023
This is a good idea. I've often wanted to do something similar, to check whether another developer has run the cleanup.
jmgrassau commentedon Sep 26, 2023
Hi ZEAL-IT and Josh,
that's indeed a good point – ABAP cleaner starts a "rewrite session" when opening the interactive cleanup, which prevents other people from changing the object in the meantime.
A "read only" mode would also be beneficial when looking at legacy code (or any code in non-development systems) which you can't or won't change at that moment: With the cleanup rules applied, the code might simply be easier to read and understand.
So, yes, very nice idea – I'd only hesitate a bit about adding another menu item (and shortcut?) for it.
For the time being, a quick workaround would be to install the stand-alone version in parallel: You can paste any amount of ABAP code into that just via clipboard, as long as blocks like
IF ... ENDIFare complete (see usage). Both the stand-alone version and the ADT plug-in share the same profile settings etc., which are saved on the local machine.Kind regards,
Jörg-Michael
ZEAL-IT commentedon Sep 26, 2023
That would be a cool feature too. The code pal would insert a line at the beginning with a checksum or something and an ATC check can check if the comment exists and the checksum is correct
ZEAL-IT commentedon Sep 26, 2023
Haven't thought of the standalone version, thank you! I guess you can't tell if the class is already locked (in that case the edit mode would be fine) or if the class is in read only mode (which it is in Eclipse until you change something)
vonglan commentedon Sep 29, 2023
+1 (to the general idea of a read-only, not locking mode)
jmgrassau commentedon Oct 1, 2023
Hi ZEAL-IT, Josh and Edo,
with the next ABAP cleaner release, there will now be a third menu item (hope the menu text + shortcut are intuitive?)
This opens the interactive window without locking the object, so you can also call it if someone else locked the object, or you don't have a transport, or you're in the wrong client, or you don't even have development authorization in the system.
Inside the ABAP cleaner UI, everything is exactly the same, except that you don't have the "Apply and Close" button and menu, but instead, you only have
and
So whatever you do inside the ABAP cleaner UI, the code in the ADT editor will not be affected. You can nevertheless change ABAP cleaner configuration (selected profile, restriction to ABAP release, activation of rules, rule options etc.) just as you would in the interactive cleanup, and these changes are kept.
Another small improvement is that the window title now also shows the ABAP release of the system in which the code editor was opened:
Kind regards,
Jörg-Michael
jmgrassau commentedon Oct 1, 2023
P.S.: If you have better suggestions for "Preview as Read-Only With ABAP Cleaner…", please let me know. "Show Read-Only Preview of Cleanup With ABAP Cleaner…" would be more precise, but that would be a bit long. I also considered "Preview (Read-Only) With ABAP Cleaner…", but the parentheses look a bit awkward in the menu.
Regarding the shortcut, Ctrl+5 would probably also be available, but since this opens the UI, I felt that it is better to have a shortcut that is similar to Ctrl+Shift+4. Anyway, everybody could configure this as needed – and I know, on certain macOS releases, both Ctrl+Shift+4 and Ctrl+Shift+5 are reserved by the system for screenshot(?) functionality.
ZEAL-IT commentedon Oct 2, 2023
Hi Jörg-Michael,
that is awesome, thank you! For the text I think just "Preview with ABAP Cleaner" is enough, but yours works too for sure. I agree with the shortcut, it should be Ctrl+Shift and the 5 just makes sense
jmgrassau commentedon Oct 2, 2023
Hi ZEAL-IT,
thanks a lot! I actually changed the menu text again to "Show Read-Only Preview With ABAP Cleaner…", because I felt "Preview as Read-Only" sounded a bit awkward (but I'm obviously not a native speaker).
Anyway, I somehow wanted to have "Read-Only" in the text in order to point out the difference to the interactive cleanup – which could of course also be used as a preview, if you close it with "Cancel".
Release process is on its way now, so this will be available very soon :-)
Kind regards,
Jörg-Michael
add menu "Preview as Read-Only With ABAP Cleaner..." (SAP#114)
add menu "Preview as Read-Only With ABAP Cleaner..." (#114)
jmgrassau commentedon Oct 2, 2023
Hi ZEAL-IT,
thanks again for this great idea! This is now available with version 1.6.0, which was just released!
Kind regards,
Jörg-Michael
JoachimRees commentedon Oct 4, 2023
This all makes a lot of sense, thanks a lot!