Toad World® Forums

Problem when commenting closed block


#1

Hi

I finally manage to make a small example of the problem.
This happens also in packages and sometimes the code after the block will not appear unless you re-open the package

Example:

begin

<>
begin
null;

<>
begin
null;
end b;
end a;

end;

1- close block b will show something like

begin

<>
begin
null;

  • <>
    end a;

    end;

2- comment the block as shown below
a)

begin

<>
begin
null;

  • <>
    */ end a;

    end;

b)
begin

<>
begin
null;

  • /* <>
    */ end a;

    end;

3- will result in

begin

<>
begin
null;

  • /* <>
    end;

So, the open/colapsed option is still ON and “end a;” is now “part” of the block b colapsed text

Regards
Filipe

Message was edited by: Fsilva


#2

Not fixed in build 1824


#3

Hi Filipe,

We have a CR for this and it’s targetted to 6.4. We’ll keep you posted.

Thanks,
Vincent


#4

That problem of collapsing occurs also when the “group ends” is not alone (I mean followed but a new-line)
Example:

BEGIN
IF TRUE
THEN
DBMS_OUTPUT.put_line (‘1’);
END IF; IF TRUE THEN DBMS_OUTPUT.put_line (‘1’);
END IF;
END;

will get

BEGIN
(+) IF TRUE
END;

Regards
Filipe


#5

Hi Filipe,

I don’t see an issue here. In fact, it behaves the way it should. When you collapse the first IF, its END IF becomes hidden, and so does the second IF. Therefore, its body and END IF become hidden too; otherwise, we would have END IF without the corresponding IF, which is wrong. BTW this style of coding (END IF and IF on the same line) is hardly worth supporting, is it?

What do you see here as a problem?

Regards,
Roman


#6

Hi Roman

I agree that is bad coding style but seem to be the same problem I detected above with commentaries.

I think that the collapsing should not be allowed in those situations (i.e. the end of block is followed by code or more than one line /* */ commentary )

Regards
Filipe