Why package editor "eats" leading spaces?

Package editor trims leading spaces.
For example, I've made a simple package (for illustrating another bug):

create or replace package tst_const_pkg as
    TRUE        constant        number(1)   :=  1;
    FALSE       constant        number(1)   :=  0;  
end tst_const_pkg;
/

Selecting user source give us a noramal result:
"package tst_const_pkg as
"
"
"
"    TRUE        constant        number(1)   :=  1;
"
"    FALSE       constant        number(1)   :=  0;
"
"    
"
"end tst_const_pkg;"

Header 1 Header 2
1 package tst_const_pkg as
2
3     TRUE        constant        number(1)   :=  1;
4     FALSE       constant        number(1)   :=  0;
5
6 end tst_const_pkg;


But in the package editor I see
111.png

7 comments
Comment actions Permalink

Hello Ivan,

Does it help to run Ctrl+Alt+L (Code | Reformat Code) action when you opened the package with the package editor?

0
Comment actions Permalink

Hello Andrey.

Reformat code doesn't help - there is a message: code is already properly formatted.

And, I think, this is a not very good idea to reformat code with internal 0xDBE rules. The code can be wrote not by me but another developer and it is need to see original code, not reformatted.

0
Comment actions Permalink

I'll raise Ivan a few KLOC, too: I reported long ago not only the failure of 0xDBE to display package code as it is stored, but also how its "format code" tool can *destroy* a package. I once had several 1000 lines of coding made useless by the formatter when some small bit of code was shifted. I recover by rolling the package back to a previous version from my instance's archive.

0
Comment actions Permalink

Do you have YouTrack issue for this problem or another reference?

It seems there is a known issue with formatting, please vote for it in YouTrack https://youtrack.jetbrains.com/issue/DBE-1034 .

0
Comment actions Permalink

The YouTrack issue you quote is mine -- I opened it about this very issue.  So I guess I've already voted for fixing the behavior. ;-)

0
Comment actions Permalink

I voted the DBE-1034

0
Comment actions Permalink

Okay, thank you, guys!

0

Please sign in to leave a comment.