abap-cleaner icon indicating copy to clipboard operation
abap-cleaner copied to clipboard

Feature Request: Format CDS Views

Open BjoernTheDev opened this issue 2 years ago • 8 comments

Espacially Case Statements

BjoernTheDev avatar May 17 '23 12:05 BjoernTheDev

Doesn't CDS already have its own configurable pretty printer implementation in the base ADT installation?

fabianlupa avatar May 19 '23 08:05 fabianlupa

have not found any settings for "Case" statements. And the goal for the abap cleaner is to be better than the "pretty printer" so why not add cds?

BjoernTheDev avatar May 19 '23 09:05 BjoernTheDev

As far as I am aware the CDS pretty printer is implemented client side in ADT (i. e. in Java). Therefore it should already be independant of the backend release lifecycle and be extensible. Though of course I am all for it being open sourced as well :P

I also couldn't find any settings specific to case statements. Just for reference:

image

fabianlupa avatar May 19 '23 09:05 fabianlupa

Hi Björn,

thanks for the idea – however, I'm afraid this is out of scope for ABAP cleaner, at least for the foreseeable future, because the tool was designed with (esp. object-oriented) ABAP in mind.

Kind regards, Jörg-Michael

jmgrassau avatar May 21 '23 13:05 jmgrassau

Too bad that this is out of scope. It would be great, especially for the annotations. Such a pain in the arse:) Kudos for this great project anyway!!!

kaisicker avatar Oct 01 '23 03:10 kaisicker

Hi @BjoernTheDev and @kaisicker,

as you maybe already noted in the Release Notes for version 1.19.1, ABAP cleaner now finally supports formatting of CDS views (i.e. Data Definition Language)! Therefore, very glad to remove the "out of scope" label for one of our oldest issues :-)

Formatting of annotations as requested by @kaisicker is already supported by the rules "Standardize annotation layout" and "Rearrange annotations". However, @BjoernTheDev originally asked about CASE statements, for which there is indeed no rule yet (but we're a lot closer now!), therefore reopening this with label "new cleanup rule" :-)

Kind regards, Jörg-Michael

jmgrassau avatar Oct 03 '24 07:10 jmgrassau

Thank you so very much!

kaisicker avatar Oct 03 '24 09:10 kaisicker

@jmgrassau thank you so much.😊

BjoernTheDev avatar Oct 03 '24 09:10 BjoernTheDev