Comments (4)
I guess you are using different settings. With the latest settings for SQLDev 20.2 the result is the following:
FUNCTION get_id1 (
p_1 NUMBER,
p_2 NUMBER,
p_3 NUMBER
) RETURN NUMBER IS
local_1 NUMBER;
local_2 NUMBER;
local_3 NUMBER;
local_4 NUMBER;
local_5 NUMBER;
BEGIN
RETURN 9999;
END get_id1;
FUNCTION get_id2 (
p_1 my_table.id%TYPE,
p_2 my_table.id%TYPE,
p_3 my_table.id%TYPE
) RETURN my_table.id%TYPE IS
local_1 my_table.id%TYPE;
local_2 my_table.id%TYPE;
local_3 my_table.id%TYPE;
local_4 my_table.id%TYPE;
local_5 my_table.id%TYPE;
BEGIN
-- some code
RETURN 9999;
END get_id2;
from plsql-formatter-settings.
Yes you are right, there are 2 settings I changed
- indentation from 3 to 4 spaces (this alone doesn't make a difference)
- and in Line Breaks - After statements changed from Single to Double Break
The (2) is essential as I want to have empty lines between individual functions and procedures. Once I change that, new line is added after IS
CREATE OR REPLACE PACKAGE BODY abc AS
FUNCTION get_id1 (
p_1 NUMBER,
p_2 NUMBER,
p_3 NUMBER
) RETURN NUMBER IS
local_1 NUMBER;
local_2 NUMBER;
local_3 NUMBER;
local_4 NUMBER;
local_5 NUMBER;
BEGIN
RETURN 9999;
END get_id1;
FUNCTION get_id2 (
p_1 my_table.id%TYPE,
p_2 my_table.id%TYPE,
p_3 my_table.id%TYPE
) RETURN my_table.id%TYPE IS
local_1 my_table.id%TYPE;
local_2 my_table.id%TYPE;
local_3 my_table.id%TYPE;
local_4 my_table.id%TYPE;
local_5 my_table.id%TYPE;
BEGIN
-- some code
RETURN 9999;
END get_id2;
END;
Any suggestion how to achieve this?
from plsql-formatter-settings.
Thank you for the additional information. Now I can reproduce the behaviour.
The brkX2_1
query handles that. This part of the expression is responsible for the additional, conditional line break:
| [node) is_or_as & [node+1) decl_list & [(node+1)+20 < (node+1)) -- long declarations
I'm going to change the behaviour as follows, if X2 is enabled:
- never add a new line after
as_or_is
for PL/SQL units - add always a new line after
as_or_is
for a package specification or package body
from plsql-formatter-settings.
Thanks for this too. Going to try it soon.
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.