Comments (3)
Indentation of comments
The indentation is never changed. There is one exception. When you set "Line Breaks Before line comments". In this case, after processing the Arbori programm, the post-processor in SQLDev's formatter adds a new line with some indentation (which is not always correct).
It's not foreseen in SQLDev to format comments. Comments are not part of provided parse-tree. Therefore you cannot query them with Arbori. Of course there are options (where you do the parsing yourself). But for the time being comment indentation handling is not a provided feature. You can place one or more comments before and after every single token. Formatting them without a proper context (provided by a parse-tree) is very very challenging.
As a result all requests/issues regarding comments are rejected. Comments are processed with the default logic of SQL Developer. If you'd like to change that, then I suggest to submit a change request for SQL Developer or discuss it in the SQL Developer's forum.
Empty Lines
The preference is called internally extraLinesAfterSignificantStatements
. So the name in the UI Line Breaks After statements
is a bit misleading.
The Query brkX2
defines the "significant" statements. I understand that it is wanted to add an empty line after "as/is" for a package or package body to separate the first unit like the subsequent ones. But for the declare section in general? If you do that then you should also add a new line after the "as/is" of a function/procedure, right?
I'm not ready to change that.
However, If you want to add it in your Arbori file variant. Look for brkX2_1
and add this line:
| [node) 'DECLARE'
BTW: the brkX2
query is also responsible to identify the statements where an empty line is preserved (beside empty lines around comments).
However, I agree that the current definition might not be consistent (e.g. an empty line is added before END
of a package but not before the end of a package body). But these would be separate issues.
Therefore I close this issue.
from plsql-formatter-settings.
Fair enough :) Re empty line, I actually don't like the empty line after that package body (i.e. on line 19 in that comparison screenshot) and I would prefer not having it, just like after the declare. So for my purposes I just commented out this line from arbori:
-- | [node) is_or_as & ([node^) pkg_body | [node^) pkg_spec) -- salvisberg: added to solve issue #12 unconditional break after is_or_as of pkg_body/pkg_spec
from plsql-formatter-settings.
Yes, a lot of personal preferences are involved here.
Therefore I would like to switch back to "Preserve Original" as default as soon as the remaining problems (wrong indent, unwanted new lines) are solved. This requires corrections in the SQLDev code, which means that this will not be before 20.4.
With "Preserve Original" it would be nice to be able to add more optional empty lines. Based on this we could declare some additional "significant" statements. The side effect would be that "Double break" becomes less attractive.
from plsql-formatter-settings.
Related Issues (20)
- formatting large files with repetitive statements, i.e. insert HOT 3
- noformat not working HOT 6
- Superb Script HOT 2
- Package constant formatting HOT 1
- Function header formatting: return deterministic HOT 1
- Support SQLDev 23.1.0 HOT 1
- Add - Formatierung "CASE WHEN" in SELECT statemen HOT 4
- Newlines being inserted into strings HOT 4
- Concatenation Bars being split apart invalidating strings HOT 2
- compiler flag concatenated to same line as end statement HOT 2
- Support SQLcl 23.3
- Do not reset Arbori program when importing trivadis_advanced_format.xml
- Unwanted line break after `whenever oserror` breaks code
- Wrong indentation in subqueries of with_clause in insert statements
- Unwanted line break before `on conversion error` in subquery
- spaces removed in grant statement
- Patching SQL Developer breaks Script Output tab feedback of direct SQL statement execution HOT 8
- Support SQLcl 23.4.0
- Can't export data after patch HOT 1
- Connection window is empty and not able to create any new database connection HOT 3
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 plsql-formatter-settings.