Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2017-10

Code outline feature of the IDE

16 messages · 11 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Werner Pamler

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>

Vojtěch Čihák

Hi,
 
I even didn't know this feature, but... so much colors, I almost collapsed :-)  
Are there plans to make it (more) configurable? Keep keywords black and only lines colorful, or paint lines only when code-block exceeds vertical screen size.  
Thanks.

Michael Van Canneyt
to Werner Pamler: The new outline feature of the IDE in Laz 1.8 and trunk is extremely helpful in locating…
Werner Pamler wrote 26 lines
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?

Interestingly, I had a discussion recently with one of the authors of this functionality (Pascal Riekenberg). He had remarks about exactly this point. He uses the C style of putting "begin" at the end of the for/if/while line, while I use the Object Pascal style of putting begin on a separate line.

I suppose that as a result of this discussion, the behaviour may still be fine-tuned.

Michael.

Sven Barth
to Michael Van Canneyt

Am 20.10.2017 14:06 schrieb "Michael Van Canneyt via Lazarus" <

Show quoted text 9 lines
: On Fri, 20 Oct 2017, Vojtěch Čihák via Lazarus wrote: > Hi, > > I even didn't know this feature, but... so much colors, I almost

collapsed :-)

Show quoted text 5 lines
:) Personally, I disabled find it more disturbing than helpful.

I agree with Vojtěch: the lines are fine, but the colored keywords are too much for me ^^'

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20171020/90bdedad/attachment.html>

Werner Pamler
to Michael Van Canneyt: :) Personally, I disabled find it more disturbing than helpful. Michael.
Michael Van Canneyt wrote 5 lines
On Fri, 20 Oct 2017, Vojtěch Čihák via Lazarus wrote: > I even didn't know this feature, but... so much colors, I almost > collapsed :-) Personally, I disabled find it more disturbing than helpful.

This was my initial reaction, too. But later I decided to give it a try and forced myself to keep it on for some days. Once I got accustomed to the many colors it turned out to be very helpful in particular for longer routines written by somebody else using an indentation style different from mine.

Donald Ziesig
to Werner Pamler: The new outline feature of the IDE in Laz 1.8 and trunk is extremely helpful in locating…

Hi All!

The new code outline feature of the IDE sounds interesting but I must have missed something along the way. :-[

I perused what I thought were the appropriate IDE Menu items but didn't see anything that matched.  I have searched all the messages on this list and the only ones that mention this feature arrived today.  I looked at the release notes, etc. for 1.8 again with negative results.

What magic do I need to enable this feature? :-D

Thanks,

Don Ziesig

Vojtěch Čihák
to Werner Pamler: The new outline feature of the IDE in Laz 1.8 and trunk is extremely helpful in locating…

Tools -> Options... -> (Nodes) Editor / Display / Markup and Matches. There's checkbox Outline (global). It took me a while too :-).  
V.
______________________________________________________________

Show quoted text 5 lines
Od: Donald Ziesig via Lazarus Komu: Datum: 20.10.2017 17:07 Předmět: [Lazarus] How to enable Code outline feature of the IDE

Hi All!

The new code outline feature of the IDE sounds interesting but I must have missed something along the way. :-[

I perused what I thought were the appropriate IDE Menu items but didn't see anything that matched.  I have searched all the messages on this list and the only ones that mention this feature arrived today.  I looked at the release notes, etc. for 1.8 again with negative results.

What magic do I need to enable this feature? :-D

Thanks,

Don Ziesig

Graeme Geldenhuys
to leledumbo: Guess somebody needs to update this page: http://wiki.freepascal.org/New_IDE_features_sinc…
leledumbo wrote
Guess somebody needs to update this page: http://wiki.freepascal.org/New_IDE_features_since :)

Wow, a lot has been added to that page since I started it 7 years ago! Just goes to show how great open source projects can be. Keep up the good work everybody.

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp
Donald Ziesig
to Mattias Gaertner: On Fri, 20 Oct 2017 11:07:51 -0400 It is mentioned in the release notes:…
Mattias Gaertner wrote 13 lines
On Fri, 20 Oct 2017 11:07:51 -0400 Donald Ziesig via Lazarus wrote: > [...]I > looked at the release notes, etc. for 1.8 again with negative results. It is mentioned in the release notes: http://wiki.freepascal.org/Lazarus_1.8.0_release_notes "New colored outline of source structure." A link to a description would be nice. Mattias

Dang!  I searched for "code outline" and didn't find it. :-(   I just tried only "outline" and there it was!:-)

Thanks,

Don

Kostas Michalopoulos
to Werner Pamler: This was my initial reaction, too. But later I decided to give it a try and forced myself…

I think the problem is that the colors are too bright and saturated, just desaturating the colors and making them darker would solve the issue.

Similarly with the lines, but with their brightness to be only a tad lower than the background itself so they are mostly invisible (except perhaps the innermost one where the cursor is). Also i'd make them dotted instead of solid.

Beyond that i think it is a nice feature to have and - if the above issues are addressed - i can see myself using it.

On Fri, Oct 20, 2017 at 3:38 PM, Werner Pamler via Lazarus <

Show quoted text 25 lines
wrote: Am 20.10.2017 um 14:05 schrieb Michael Van Canneyt via Lazarus: > On Fri, 20 Oct 2017, Vojtěch Čihák via Lazarus wrote: > >> I even didn't know this feature, but... so much colors, I almost >> collapsed :-) >> > Personally, I disabled find it more disturbing than helpful. > This was my initial reaction, too. But later I decided to give it a try and forced myself to keep it on for some days. Once I got accustomed to the many colors it turned out to be very helpful in particular for longer routines written by somebody else using an indentation style different from mine. -- _______________________________________________ Lazarus mailing list https://lists.lazarus-ide.org/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20171021/3a48bc04/attachment.html>

Graeme Geldenhuys
to Kostas Michalopoulos
Kostas Michalopoulos wrote
I think the problem is that the colors are too bright and saturated, just desaturating the colors and making them darker would solve the issue.

Whoever decides to make that change, please remember to use theme colors and not hard-coded values, otherwise it will not work with multiple themes. eg: I use a custom blank theme on one system and a Dark Solarize on another system (sometimes switching to the Light Solarize depending on the ambient lighting where I might be working).

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp