[Lazarus] Code outline feature of the IDE
Werner Pamler
werner.pamler at freenet.de
Fri Oct 20 12:53:52 CEST 2017
The new outline feature of the IDE in Laz 1.8 and trunk is extremely
helpful in locating code block inconsistencies. I cannot imagine how I
could have lived without it in older versions.
In my opinion, however, it is not always working correctly:
A "for" loop with a "begin"/"end" block ("for ... do begin end;") is a
logical entity of the code; there is only a single semicolon which
terminates this sequence. Therefore I'd expect all four keywords to be
painted in the same color, no matter of how the code is formatted.
The IDE behaves differently, however. Look at screenshot "orig.png"
which is taken from the current LCLtranslator.pas of trunk and
essentially shows a "for" loop with a "begin"/"end" block. However, the
author of this unit likes to put the "begin" into a new line and to
indent it with respect to its "for" parent. Note that the IDE now
switches color - "for...do" and "begin"/"end" are colored differently. -
I think this is wrong
This changes if the indentation of "begin" is modified to match that of
"for" (screenshot "modif-1.png"), or if "begin" is kept in the same line
as "for" (screenshot "modif-2.png"). Now all three keywords are colored
equally. - I think this is correct.
How can it be that the logical relation between keywords depends on the
way of writing? Is this a bug? Or is it just that my understanding of
the Pascal block concept is wrong?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: orig.png
Type: image/png
Size: 10987 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20171020/dd226813/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: modif-1.png
Type: image/png
Size: 10296 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20171020/dd226813/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: modif-2.png
Type: image/png
Size: 10888 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20171020/dd226813/attachment-0005.png>
More information about the Lazarus
mailing list