Improve readibility of where block with multiple and nested and/or
See original GitHub issueContexte
Content before formatting:
Content after formatting:
As you can see in the images, formatting the querry has reduced it’s readibility:
and
andor
have the same line break rules- nested parenthesis are totally ignore in the formatting
Describe the solution you’d like
I think the readibility would be better if nested parenthesis’s elements are right indented +1, example:
(The same indentation could be done between the or
and and
statement to visually identify the evaluation groups)
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How would you refactor nested IF Statements? [duplicate]
1 - Nested Small Functions. Take each if and its code block and turn it into a function. If the boolean check fails,...
Read more >Untangling Nested Code - Jason McCreary
Let's take a look at a few examples of nested code and practices for improving their readability. Empty blocks. You may not believe...
Read more >6 Tips to Improve Your Conditional Statements for Better ...
6 Tips to Improve Your Conditional Statements for Better Readability · 1. Returning Early Instead of if…else · 2. Using Array.includes · 3....
Read more >How can I simplify or improve readability in complex logic ...
I'd simply use a temporary variable to clean things up: auto code = ncode[i] + key[ikey]; if ( (code > 90 && code...
Read more >nginx giving priority to nested location over outer location block
Yes nginx has to choose one location so it won't report the matching later even if you are nesting these. When you use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Implemented in DBeaver 21.0.2 DBeaver will add indents for OR, AND keywords, if they are first in brackets.
Example:
Result will be:
verified