Sign in Join

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

Mailing lists / lazarus / 2009-04

ide enhancement - method or cursor location belongs to what class?

23 messages · 8 people · –

Reply by email Subscribe to this list Your subscription

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

Graeme Geldenhuys

Hi,

I often have large classes that are bigger than what the source editor can 'm mainly talking about tiOPF project here.
Anyway, I receive patches for large methods and use the IDE 'goto line' command to maybe review or modify a received patch. Again, the IDE only shows me lines of code, I can't clearly see which class I am currently working in. Ctrl+Shift+UpArrow doesn't reveal this info either, because again the class declaration is large and doesn't fit into the source editor there a way to quickly see what class I am currently in without loosing my current position in the source code? I was thinking of maybe some editor shortcut that could display for a few seconds the classname in the top right corner of the editor and then simply fade away. Is this possible? Is there already something similar in Lazarus IDE or another way of know what class I am currently in?

I remember in the VB6 days, there was two edit fields above the editor. One listed the module or class (I think) and the other listed the procedure you were in. So clearly knowing where you are is handy to more than just me. :-)

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

ik
to Graeme Geldenhuys

Why not to use the Status bar for that ? It also can remain there as long as you inside the method etc..

I suggested an idea that was rejected by most people on this list: have an ability to split the editor, I use it in VIM for example when I need to see additional information without loosing my main work area.

Ido

Graeme Geldenhuys wrote 35 lines
Hi, I often have large classes that are bigger than what the source editor can 'm mainly talking about tiOPF project here. Anyway, I receive patches for large methods and use the IDE 'goto line' command to maybe review or modify a received patch. Again, the IDE only shows me lines of code, I can't clearly see which class I am currently working in. Ctrl+Shift+UpArrow doesn't reveal this info either, because again the class declaration is large and doesn't fit into the source editor all at once. Is there a way to quickly see what class I am currently in without loosing my current position in the source code? I was thinking of maybe some editor shortcut that could display for a few seconds the classname in the top right corner of the editor and then simply fade away. Is this possible? Is there already something similar in Lazarus IDE or another way of know what class I am currently in? I remember in the VB6 days, there was two edit fields above the editor. One listed the module or class (I think) and the other listed the procedure you were in. So clearly knowing where you are is handy to more than just me. :-) Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090402/d6fd11d7/attachment.html

Reply by email

Graeme Geldenhuys
to ik

2009/4/2 ik :

Why not to use the Status bar for that ? It also can remain there as long as you inside the method etc..

I though of that just after I posted that message. Maybe the full path unit name can be shorten with ellipses in the middle and space created for the class name. The problem is, sometimes class names are long, so what happens if they don't fit into the allocated area? Can you have tooltips on a statusbar area?

Creating a editor tooltip (similar to what the original SynEdit has for showing line numbers while you scroll) will overcome the long class names. The tooltip can adjust to whatever size is required.

I suggested an idea that was rejected by most people on this list: have an ability to split the editor, I use it in VIM for example when I need to see additional information without loosing my main work area.

This would be great, but is still not going to solve my problem, plus now my editor space (visible lines I can see at once) is going to be even smaller. I see around 43 lines of code at once in my current editor, but have no clue what class I am in. This gets even worse if the current method has nested procedures and functions.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys: I often have large classes that are bigger than what the source editor can 'm mainly…
Graeme Geldenhuys wrote 7 lines
Is there a way to quickly see what class I am currently in without loosing my current position in the source code? ?I was thinking of maybe some editor shortcut that could display for a few seconds the classname in the top right corner of the editor and then simply fade away. Is this possible? Is there already something similar in Lazarus IDE or another way of know what class I am currently in?

Another nice feature which could be added to the tooltip would be the visibility of the current method: private, protected, public or published. I often find while viewing the class declaration that i have to PgUp a few times to find out what visibility is currently being used.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Mattias Gaertner
to Graeme Geldenhuys: I often have large classes that are bigger than what the source editor can 'm mainly…
Show quoted text 22 lines
Hi, I often have large classes that are bigger than what the source editor can 'm mainly talking about tiOPF project here. Anyway, I receive patches for large methods and use the IDE 'goto line' command to maybe review or modify a received patch. Again, the IDE only shows me lines of code, I can't clearly see which class I am currently working in. Ctrl+Shift+UpArrow doesn't reveal this info either, because again the class declaration is large and doesn't fit into the source editor all at once. Is there a way to quickly see what class I am currently in without loosing my current position in the source code? I was thinking of maybe some editor shortcut that could display for a few seconds the classname in the top right corner of the editor and then simply fade away. Is this possible? Is there already something similar in Lazarus IDE or another way of know what class I am currently in? I remember in the VB6 days, there was two edit fields above the editor. One listed the module or class (I think) and the other listed the procedure you were in. So clearly knowing where you are is handy to more than just me. :-)

Code explorer can follow the cursor.

Mattias

Reply by email

ik
to Graeme Geldenhuys: 2009/4/2 ik : I though of that just after I posted that message. Maybe the full path unit…
Graeme Geldenhuys wrote 14 lines
2009/4/2 ik : > Why not to use the Status bar for that ? It also can remain there as long as > you inside the method etc.. I though of that just after I posted that message. Maybe the full path unit name can be shorten with ellipses in the middle and space created for the class name. The problem is, sometimes class names are long, so what happens if they don't fit into the allocated area? Can you have tooltips on a statusbar area? Creating a editor tooltip (similar to what the original SynEdit has for showing line numbers while you scroll) will overcome the long class names. The tooltip can adjust to whatever size is required.

You can place ToolTips for each band.

Show quoted text 13 lines
> I suggested an idea that was rejected by most people on this list: have an > ability to split the editor, I use it in VIM for example when I need to see > additional information without loosing my main work area. This would be great, but is still not going to solve my problem, plus now my editor space (visible lines I can see at once) is going to be even smaller. I see around 43 lines of code at once in my current editor, but have no clue what class I am in. This gets even worse if the current method has nested procedures and functions.

Buy a bigger screen :D
I'm using a wide screen of 1680x1050, yet there are always more lines I can use.
I also seen a Google employee that rotate his wide screen so instead of the wide part is to the sides, it's on top to bottom, so he can gain more data (but you need a screen that support rotation with it's holders).

Show quoted text 8 lines
Regards, - Graeme -

Ido
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090402/cf6dce52/attachment.html

Reply by email

Martin Friebe
to ik: Why not to use the Status bar for that ? It also can remain there as long as you inside…
ik wrote 6 lines
Why not to use the Status bar for that ? It also can remain there as long as you inside the method etc.. I suggested an idea that was rejected by most people on this list: have an ability to split the editor, I use it in VIM for example when I need to see additional information without loosing my main work area.

Me too. I think the status bar will be a good place.

I don't see a problem with splitting in general, but it depends on the way it will be implemented. IMHO It is a case of adding 2 things:
- Allowing several instances of SynEdit to show the same source
- Docking. so you can choose between multi-window and single/slitted window.

Btw, the best you can do for now is to disable the "Caret always visible". then the caret will keep it's position, even if scrolled out of the visible area.
It allows you to scroll (mouse only) and once you found what you where looking for, just type caret-left-key and you are back (well one position to the left)

Show quoted text 31 lines
On Thu, Apr 2, 2009 at 12:42 PM, Graeme Geldenhuys < <mailto:>> wrote: Hi, I often have large classes that are bigger than what the source editor can 'm mainly talking about tiOPF project here. Anyway, I receive patches for large methods and use the IDE 'goto line' command to maybe review or modify a received patch. Again, the IDE only shows me lines of code, I can't clearly see which class I am currently working in. Ctrl+Shift+UpArrow doesn't reveal this info either, because again the class declaration is large and doesn't fit into the source editor all at once. Is there a way to quickly see what class I am currently in without loosing my current position in the source code? I was thinking of maybe some editor shortcut that could display for a few seconds the classname in the top right corner of the editor and then simply fade away. Is this possible? Is there already something similar in Lazarus IDE or another way of know what class I am currently in? I remember in the VB6 days, there was two edit fields above the editor. One listed the module or class (I think) and the other listed the procedure you were in. So clearly knowing where you are is handy to more than just me. :-) Regards, - Graeme -

Reply by email

Graeme Geldenhuys
to Mattias Gaertner: On Thu, 2 Apr 2009 11:42:48 +0200 Code explorer can follow the cursor. Mattias
Mattias Gaertner wrote
Code explorer can follow the cursor.

That's what I tried first, but can't see how or where it indicates what class. I'm currently in a method as follows:
TtiObjectListTestCase.FindByProps_PropertyPath

Yet the Code Explorer doesn't give me any hints on that fact.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot.png
Type: image/png
Size: 9672 bytes
Desc: not available
Url : http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090402/b482c035/attachment-0001.png

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys
Graeme Geldenhuys wrote 8 lines
> > Code explorer can follow the cursor. That's what I tried first, but can't see how or where it indicates what class. I'm currently in a method as follows: TtiObjectListTestCase.FindByProps_PropertyPath Yet the Code Explorer doesn't give me any hints on that fact.

And here is the expanded view in case that was required... Again nothing showing me I am in the "FindByProps_PropertyPath" method. That tree node looks like all the others.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot2.png
Type: image/png
Size: 8415 bytes
Desc: not available
Url : http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090402/8d05a7c6/attachment.png

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys
Graeme Geldenhuys wrote 14 lines
On Thu, Apr 2, 2009 at 12:47 PM, Graeme Geldenhuys wrote: >> >> Code explorer can follow the cursor. > > That's what I tried first, but can't see how or where it indicates > what class. I'm currently in a method as follows: > TtiObjectListTestCase.FindByProps_PropertyPath > > Yet the Code Explorer doesn't give me any hints on that fact. And here is the expanded view in case that was required... Again nothing showing me I am in the "FindByProps_PropertyPath" method. That tree node looks like all the others.

And in case you were wondering what version of Lazarus I am using: v0.9.27 r19175M i386-linux-gtk

One day old trunk revision.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Sayyid Ibnu Husein Alatas
to Graeme Geldenhuys: 2009/4/2 ik : I though of that just after I posted that message. Maybe the full path unit…

Graeme Geldenhuys wrote:
....
Is there a way to quickly see what class I am currently in without loosing my current position in the source code? I was thinking of maybe some editor shortcut that could display for a few seconds the classname in the top right corner of the editor and then simply fade away. Is this possible? Is there already something similar in Lazarus IDE or another way of know what class I am currently in? ....
_______________________________________________

ik wrote:

Why not to use the Status bar for that ? It also can remain there as long as you inside the method etc.
....
_______________________________________________

Firstly, I propose the "Code Explorer" also includes "Classes" item containing tree of available classes.

Secondly, I propose the current active class has a different color from others.

By the way, the "Code Explorer" has been rename to "Structure" in Delphi 2009, and it has a shortcut, that is Shift+Alt+F11. Why don't implement the shortcut?

In regard to ik's view, I think it will survive just for a moment since the details on status bar likely to increase in the future.

Best Regards
Sayyid Ibnu Husein Alatas

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090402/acd18a90/attachment.html

Reply by email

Reenen Laurie
to Graeme Geldenhuys: On Thu, Apr 2, 2009 at 12:47 PM, Graeme Geldenhuys And here is the expanded view in case…
Graeme wrote 5 lines
I remember in the VB6 days, there was two edit fields above the editor. One listed the module or class (I think) and the other listed the procedure you were in. So clearly knowing where you are is handy to more than just me. :-)

I tried to implement *exactly that* in the IDE a while back... I got it on the Source Editor form, but then to actually change the selection as you go along, I realized I know / understand *way* too little about the Source Editor. I was unable to even populate it with all the available functions etc.

Personally, I'd like to see it implemented with the two comboboxes, because not only does it show you where you are, but also lets you go where you want to go pretty easily.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090402/89c7e96f/attachment.html

Reply by email

Graeme Geldenhuys
to Reenen Laurie

2009/4/2 Reenen Laurie :

Personally, I'd like to see it implemented with the two comboboxes, because not only does it show you where you are, but also lets you go where you want to go pretty easily.

That's why I ported the "Procedure List" expert a year or so ago. It allows me to jump very quickly to methods in a class - all without taking my hands off the keyboard. I think "procedure list" is now installed as standard in the IDE.
You should be able to find it at "Search | Procedure List" or simply press Ctrl+G (or maybe the default shortcut is Ctrl+Shift+G).

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Alexander Klenin
to Graeme Geldenhuys
Graeme Geldenhuys wrote 7 lines
On Thu, Apr 2, 2009 at 12:28 PM, Mattias Gaertner wrote: > > Code explorer can follow the cursor. Can you explain how? I tried all the settings in Code Explorer and nothing allows the following the cursor behaviour.

Perhaps Mattias wanted to say that Code Explorer _could_ be made to follow cursor?

FWIW, I have many ideas for Code Explorer, and perhaps will even implement some of them --
but for now, my hands are full. Highlighting current cursor position is one of those.

Alexander S. Klenin

Reply by email

Martin Friebe
to Graeme Geldenhuys: I often have large classes that are bigger than what the source editor can 'm mainly…
Graeme Geldenhuys wrote 18 lines
Hi, I often have large classes that are bigger than what the source editor can 'm mainly talking about tiOPF project here. Anyway, I receive patches for large methods and use the IDE 'goto line' command to maybe review or modify a received patch. Again, the IDE only shows me lines of code, I can't clearly see which class I am currently working in. Ctrl+Shift+UpArrow doesn't reveal this info either, because again the class declaration is large and doesn't fit into the source editor all at once. Is there a way to quickly see what class I am currently in without loosing my current position in the source code? I was thinking of maybe some editor shortcut that could display for a few seconds the classname in the top right corner of the editor and then simply fade away. Is this possible? Is there already something similar in Lazarus IDE or another way of know what class I am currently in?

There is now.... revision 19499

you need the mouse (so it isn't as quick and convenient as a key-command driven hint).
The Fold-Gutter part now has it's own Pop-up menu. (only at lines that have folding present). And it shows all the nested levels.

Best Regards
Martin

Reply by email

Graeme Geldenhuys
to Martin Friebe: There is now.... revision 19499 you need the mouse (so it isn't as quick and convenient…
Martin Friebe wrote 7 lines
> There is now.... revision 19499 you need the mouse (so it isn't as quick and convenient as a key-command driven hint). The Fold-Gutter part now has it's own Pop-up menu. (only at lines that have folding present). And it shows all the nested levels.

It works on lines with code-folding present in gutter - I see the popup menu appear. But as soon as I right-click on an area in the gutter that doesn't have the code-folding, then I get an AV. I only have code folding enabled for {%region} and {%ifdef}.

The right-click is in the right most area of the gutter where the code-folding lines appear.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Martin Friebe
to Graeme Geldenhuys
Graeme Geldenhuys wrote 16 lines
On Sun, Apr 19, 2009 at 3:11 AM, Martin Friebe wrote: > There is now.... revision 19499 > > you need the mouse (so it isn't as quick and convenient as a key-command > driven hint). > The Fold-Gutter part now has it's own Pop-up menu. (only at lines that > have folding present). And it shows all the nested levels. > It works on lines with code-folding present in gutter - I see the popup menu appear. But as soon as I right-click on an area in the gutter that doesn't have the code-folding, then I get an AV. I only have code folding enabled for {%region} and {%ifdef}.

The AV is fixed in revision 19549. Thanks for the hint.

You will need to add folding at Procedure-level and Class-level (maybe class-section too), in order to see where in the code you are...

There is a need to display that kind of info independent of folding, and in a form that does not require the mouse (can be reached quicker), but for now...

Best Regards
Martin

Reply by email

Graeme Geldenhuys
to Martin Friebe
Martin Friebe wrote 5 lines
The AV is fixed in revision 19549. Thanks for the hint. You will need to add folding at Procedure-level and Class-level (maybe class-section too), in order to see where in the code you are...

Thanks, it works perfectly now. Open source projects and dedicated developers like you guys are awesome!!! :-)

There is a need to display that kind of info independent of folding, and in a form that does not require the mouse (can be reached quicker), but for now...

...for now it works fine. ;-)

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Martin Friebe: The AV is fixed in revision 19549. Thanks for the hint. You will need to add folding at…
Martin Friebe wrote
There is a need to display that kind of info independent of folding, and in a form that does not require the mouse (can be reached quicker), but for now...

I managed to get this working without the mouse. ;-)

* Enabled folding at Class and Procedure level

Using keyboard shortcuts:
* Fold at cursor --> Scroll Lock key
* Ctrl+H --> jump to last cursor position

I use Programmer Dvorak, so my keyboard shortcuts are very different to the standard ones. Shift+ScrollLock unfolds as well (but doesn't restore cursor position). That's why I rather use Ctrl+H to restort, and which unfolds automatically.

If there is a will, there is a way! ;-)

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email