Comments (6)
The ABAP formatter actually does format those examples of yours like that, on a very recent release... Unfortunately the results of the ABAP formatter are backend release dependant.
from abap-cleaner.
The ABAP formatter actually does format those examples of yours like that, on a very recent release... Unfortunately the results of the ABAP formatter are backend release dependant.
I'd be fine with that for examples 1 & 2. But does it format like abap-cleaner does even for 3? That behavior seems very odd.
from abap-cleaner.
Hi Josh,
in my ADT, ABAP Formatter indeed puts this to upper case TEXT-01
– and shows an error saying '"TEXT-01" is not a numbered text (for example: TEXT-001).' Doesn't it expect three digits on your system?
Example 2 is formatted by ABAP Formatter exactly as shown in your code, so it is indented, which I think makes sense and is consistent with formatting of BEGIN OF ... END OF
blocks in other cases like TYPES
.
Regarding example 3 – yes, it is really unfortunate that we have to break a TYPES
chain for an INCLUDE
! In my ADT, ABAP Formatter does this:
TYPES:
BEGIN OF some_type.
INCLUDE TYPE nested_type.
TYPES: field TYPE farr_contract_id,
END OF some_type.
… which looks really messy to me. Your example …
TYPES:
BEGIN OF some_type.
INCLUDE TYPE nested_type.
TYPES: field TYPE some_field,
END OF some_type.
… actually looks better for my taste, but then, isn't it a bit inconsistent to have the TYPES
keyword in two completely different positions? The second one is even indented further than END OF
!
That's why ABAP cleaner tries to have the TYPES
keywords at the same horizontal position (because they are at the same level of indentation), while moving the whole BEGIN OF ... END OF
block a bit to the right, so it can be formatted as if it all were a single chain:
TYPES: BEGIN OF some_type.
INCLUDE TYPE nested_type.
TYPES: field TYPE some_field,
END OF some_type.
So, you could say it was a conscious decision against what ABAP Formatter does…
Kind regards,
Jörg-Michael
from abap-cleaner.
Hi Josh,
in my ADT, ABAP Formatter indeed puts this to upper case
TEXT-01
– and shows an error saying '"TEXT-01" is not a numbered text (for example: TEXT-001).' Doesn't it expect three digits on your system?
Yes, this is just a typo.
Example 2 is formatted by ABAP Formatter exactly as shown in your code, so it is indented, which I think makes sense and is consistent with formatting of
BEGIN OF ... END OF
blocks in other cases likeTYPES
.
I would prefer the indentation also, so this is just a difference of versions apparently.
Regarding example 3 – yes, it is really unfortunate that we have to break a
TYPES
chain for anINCLUDE
! In my ADT, ABAP Formatter does this:TYPES: BEGIN OF some_type. INCLUDE TYPE nested_type. TYPES: field TYPE farr_contract_id, END OF some_type.… which looks really messy to me. Your example …
TYPES: BEGIN OF some_type. INCLUDE TYPE nested_type. TYPES: field TYPE some_field, END OF some_type.… actually looks better for my taste, but then, isn't it a bit inconsistent to have the
TYPES
keyword in two completely different positions? The second one is even indented further thanEND OF
!That's why ABAP cleaner tries to have the
TYPES
keywords at the same horizontal position (because they are at the same level of indentation), while moving the wholeBEGIN OF ... END OF
block a bit to the right, so it can be formatted as if it all were a single chain:TYPES: BEGIN OF some_type. INCLUDE TYPE nested_type. TYPES: field TYPE some_field, END OF some_type.So, you could say it was a conscious decision against what ABAP Formatter does…
Kind regards, Jörg-Michael
Point 3 is certainly a unique situation. On one hand, yes, I would like all TYPES
keywords in the same position, but I feel like the nested type is an exception, since it belongs inside the BEGIN
/END
block. I'm not sure I like it, but I have found that there is a "solution" which satisfies both abap-cleaner and the ATC checks we have for indentation in abapOpenChecks:
TYPES BEGIN OF some_type.
INCLUDE TYPE nested_type.
TYPES field TYPE some_field.
TYPES END OF some_type.
Not sure if others use this type of syntax, but I suppose it's a (not very obvious) compromise.
from abap-cleaner.
Closing this since there's a workaround and it's system version-dependent.
from abap-cleaner.
Hi Josh,
alright, thanks! Just to have some label assigned, I think this is somewhere in between "won't fix" and "no defect" …
Kind regards,
Jörg-Michael
from abap-cleaner.
Related Issues (20)
- fyi: Referential Integrity Problem HOT 4
- String template is proposed for JSON string without any need HOT 4
- Feature Request: Point out NULL-reference HOT 1
- Packaging: Jar file contains resources twice HOT 4
- CORRESPONDING ... EXCEPT and LOOP AT ... GROUP BY indentation HOT 6
- variable is assigned but never used not working correctly HOT 3
- Align SELECT...FROM...JOIN HOT 2
- Delete unused variables HOT 2
- ABAP Cleaner Menu greyed out for one system but not for another HOT 1
- Wrong formatting a line comment within type declaration in class HOT 7
- Feature Request: Captions for Read-Only Code Preview HOT 2
- Option: Align Parameters and Components - Issue HOT 2
- CLI parameter `--version` to show version
- Update from 1.16.2 to newer version deinstalled ABAP Cleaner and now i am not able to install ABAP Cleaner HOT 1
- Installation with Eclipse & ADT 2024-06 (4.32)
- Adjustion alignment of parameters and conditional expressions HOT 2
- Alignment of select-options and parameters
- Feature Request: ABAP cleaner on an entire package
- perhaps interesting for ABAP Cleaner too: Sort combined DATA statements (ABAP Quick Fixes 1.1.5)?
- Single line TYPES: statements do not always have the colon removed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from abap-cleaner.