Comments (4)
Hi ConjuringCoffee,
yes, that second example definitely doesn't look good (although in a way it's not wrong). On the other hand, if you had a variable name here such as ```[ lv_index ]``, it could have any length between 1 and 30 chars, and at some point you'd want a line break. So, let's see what can be done about it – maybe it should simply be prevented to introduce line breaks when the content is very short.
What I'd consider a bug is the last example, because if ABAP cleaner moves table_nested[
behind the opening (
, there is no reason to keep the line break. I'll have to check why that happens!
Kind regards,
Jörg-Michael
from abap-cleaner.
Hi ConjuringCoffee,
thanks again for opening this issue – this was indeed a bug, because table expressions that are chained with ][
were not processed properly. With your example and settings, I now get:
DATA(this_is_a_very_very_long__name) = NEW lcl_example( )->this_is_a_very_very_long_name(
table_normal[ 1 ] ).
DATA(this_is_a_very_very_long_name2) = NEW lcl_example( )->this_is_a_very_very_long_name(
table_nested[ 1 ][ 1 ] ).
Condensing also works now (without keeping unnecessary line breaks), so if you enter …
any_method(
lt_any_table[
1 ][
2 ][
3 ] ).
any_method(
par1 = lt_any_table[
1 ]
param2 = lt_any_table[
1 ][
2 ]
parameter3 = lt_any_table[
1 ][
2 ][
3 ] ).
you will get:
any_method( lt_any_table[ 1 ][ 2 ][ 3 ] ).
any_method( par1 = lt_any_table[ 1 ]
param2 = lt_any_table[ 1 ][ 2 ]
parameter3 = lt_any_table[ 1 ][ 2 ][ 3 ] ).
And an example where a line break cannot be avoided …
DATA(lv_some_value_with_a_long_name) = any_method(
lt_any_table[
lv_index ][
lv_second_index ][
lv_third_index_with_long_name ] ).
… will look like this:
DATA(lv_some_value_with_a_long_name) = any_method( lt_any_table[ lv_index ][ lv_second_index ][
lv_third_index_with_long_name ] ).
Kind regards,
Jörg-Michael
from abap-cleaner.
Hi ConjuringCoffee,
this issue should now be fixed with version 1.5.1!
Kind regards,
Jörg-Michael
from abap-cleaner.
Great, thank you!
from abap-cleaner.
Related Issues (20)
- 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
- Rule "Remove space before commas and period" duplicates template comment in function module HOT 3
- CALL FUNCTION ... DESTINATION
- Error when constant is used to specify variable size HOT 2
- Enhancement: skip unsupported statements instead of cancelling whole cleanup
- "Use FINAL" rule doesn't work when method is called in COND HOT 2
- Feature Request: Introduce ABAP-Cleaner Pragmas (e.g. skip certain code sections from applying rules) HOT 3
- Alignment of method declarations with ABSTRACT
- Feature request: Replace obsolete REFRESH with CLEAR
- Link to install file down? HOT 2
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.