Beautifier on Procedure - shifts commented lines right?

Stew Stryker

Member³
I have a stored procedure with a CURSOR and I commented out some of the returned columns. I discovered that Beautifying indents the commented text right.

It doesn't happen if you just have a SELECT by itself, only w/in a procedure or function. My original example showed up in a package and the SELECT statement was part of a cursor, but the problem occurs in much simpler examples, even ones that won't compile, like this one:

Code:
CREATE OR REPLACE PROCEDURE lookup_via_advance(search_values_in IN VARCHAR2) RETURN VARCHAR2 IS

BEGIN
    SELECT e.id_number
    /*,
           jaro_score
                */
      FROM entity e;
END;
I first noticed it when it looked like my commented lines had VANISH or the font color was white! That's because it'd shifted the text off the side of my screen and I couldn't see it.

Good luck!
 
Gustavo,

Thanks for the confirmation. Sorry to hear it existed before. Odd I never noticed. I wonder what the unique circumstances are???
 
I had noticed this behaviour in From, Where, Order By and Group By clauses.
Try to repeatedly beautify the code below.
The comment within Select will be indented in 11-character steps.

Code:
Create Or Replace Procedure test Is
  Cursor c_test Is
    Select 1/*,
           'a'*/,
           Sysdate
    From   dual d1/*,
           dual d2*/
    Where  /*d1.dummy = d2.dummy
    And    */rownum = 1
    Group  By Sysdate/*,
              obsolete*/;
Begin
  Null;
End;
The comments within the other clauses will be indented in 4-character steps.
My preferences say I have indent = 2 and tab size = 2 (same in beautifier options).
 
i have had this as well. when you comment something out and the comment marker is at the margin, then the beautifier treats the comment as part of the code(?) and aligns the start of the comment where the next line of code should be.

it also does not beautify within the comment so the spaces are preserved..
 
Back
Top