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

Request: Support ABAP Cleaner for ABAP codes in Web Dynpro projects #220

Closed
flying-crane opened this issue Dec 7, 2023 · 3 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@flying-crane
Copy link

Dear developers,

I find the ABAP Cleaner will not work for the code in Web Dynpro projects, including implementations from the view and component controllers.

image

But it can work as expected in the assistance class of the Web Dynpro projects. Please help to check.

Best regards,
Henry

@flying-crane flying-crane changed the title Feature Request: Support ABAP Cleaner for ABAP codes in Web Dynpro projects Request: Support ABAP Cleaner for ABAP codes in Web Dynpro projects Dec 13, 2023
@jmgrassau jmgrassau added the enhancement New feature or request label Jan 1, 2024
@jmgrassau
Copy link
Member

Hi Henry,

thanks for opening this issue! You're right, Eclipse seems to treat these code editors differently than the normal ABAP code editors. For those, ABAP cleaner currently defines three menus and key bindings (cp. Window -> Preferences -> General -> Keys -> search for "ABAP cleaner"):

image

Apparently, these Web Dynpro editors are not part of the context "Editing ABAP Code", presumably because of the restriction that the code is partly read-only:

image

I need to check with an ADT expert what could be done here. Currently, what you could do as a workaround:

  • copy the (entire) code from the Web Dynpro editor to the clipboard,
  • open any regular ABAP code (e.g. an ABAP class) in a different editor,
  • select menu "Source Code / Read-Only Preview With ABAP Cleaner…" there,
  • paste your code into the ABAP cleaner UI with Ctrl+V (or menu "Code / From Clipboard"),
  • use Ctrl+A and Ctrl+C to copy the cleaned code to the clipboard,
  • temporarily insert it to any text editor (e.g. Notepad),
  • from there, method by method, copy the cleaned code back to the WebDynpro editor (since pasting the whole code into the WebDynpro editor won't work due to the read-only sections).

That's a bit tedious, but compared to manual cleanup, it might nevertheless save a lot of time. Alternatively, you could

  • install the standalone version of ABAP cleaner,
  • open it next to ADT, and
  • use the menu "Code / Watch and Modify Clipboard, which immediately replaces any section of code within the clipboard, as soon as you copy it with Ctrl+C (blocks like IF ... ENDIF must be complete).
  • With that, you could stay within the WebDynpro editor, select the content of a method, press Ctrl+C ("Watch and Modify Clipboard" then plays a 'beep') and directly replace the selection with the cleaned code using Ctrl+V.

But that's only workarounds, of course! Let's see if a proper solution will be possible.

Kind regards,
Jörg-Michael

@jmgrassau jmgrassau self-assigned this Feb 9, 2024
@jmgrassau
Copy link
Member

jmgrassau commented Feb 9, 2024

Hi Henry,

good news – our ADT expert found a solution to the problem, so cleanup of WebDynpro implementations will be possible with the next release!

Kind regards,
Jörg-Michael

@jmgrassau
Copy link
Member

Hi Henry,

thanks again for pointing this out – with version 1.13.1, which was just released, the ABAP cleaner menus should now be directly available for WebDynpro implementations, too!

Unfortunately, I entered the wrong issue number #200 when committing the code changes –
enable ABAP cleaner menus for WebDynpro implementations belongs to this issue, as well as Force abapcleaner.gui plugin activation when checking handler enablement.

Kind regards,
Jörg-Michael

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants