Recent

Author Topic: Where's the Wallchart?  (Read 598 times)

syntonica

  • Full Member
  • ***
  • Posts: 120
Where's the Wallchart?
« on: December 11, 2019, 08:09:19 am »
I decided that if I'm going to be of any help around here, I had better start learning all the under-the-hood stuff. I'm starting by trying to trace a bug in lhelp since I need for immediate searchable access to docs to help me learn with less fuss and frustration.  As I'm swimming through code, I'm grepping in the Lazarus folder, then I'm off to the fpc source files. Then I'm back in the Lazarus folder, all the while pulling up files and then searching through them directly.  10 open files later and I still haven't found what I'm looking for.

Is there a resource that just gives the tree of what goes where and who owns what? So, if I'm looking for a specific method, I can see which file it's in and where that file hangs out.

A wallchart would be nice, but not necessary if I can get a single file with this information? Does autocomplete cache its info anywhere? That might be a good place to start. Thanks!

PascalDragon

  • Hero Member
  • *****
  • Posts: 949
  • Compiler Developer
Re: Where's the Wallchart?
« Reply #1 on: December 11, 2019, 09:26:01 am »
There is no such file, but there is a tool that can help you:

- open your project (in this case lhelp.lpi) in Lazarus
- go to View -> Code Browser
- change the combobox from "Lazarus IDE" to "Project" and enable the "With required packages" checkbox
- enter your procedure name in "Show identifier"
- the Code Browser will automatically search for the identifier; it might take a few moments, so be patient. :)

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7917
Re: Where's the Wallchart?
« Reply #2 on: December 11, 2019, 11:53:51 am »
The lcl.chm is clickable, and can jump to rtl.chm and fcl.chm too.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5956
    • wiki
Re: Where's the Wallchart?
« Reply #3 on: December 11, 2019, 12:32:10 pm »
So, if I'm looking for a specific method, I can see which file it's in and where that file hangs out.
No wallchart. (That I know of)

But if you look at a specific method/property: TForm.Caption

You can use Code navigation:  https://wiki.lazarus.freepascal.org/Lazarus_IDE_Tools#Summary_Table_of_IDE_shortcuts
It will get you there.

However, with properties, you often end up in the base class, and it then takes you to the generic TWinControl.SetCaption.
And TForm may have its own SetCaption.

You can work your way up. Go to "TForm" and do ALt-Up and you get to the base class, and you can go from there to the next base and so on....


marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7917
Re: Where's the Wallchart?
« Reply #4 on: December 11, 2019, 12:49:32 pm »
So, if I'm looking for a specific method, I can see which file it's in and where that file hangs out.
No wallchart. (That I know of)

There is a FCL class chart available on the documentation page. But that is mostly for quick inheritance checks.

syntonica

  • Full Member
  • ***
  • Posts: 120
Re: Where's the Wallchart?
« Reply #5 on: December 11, 2019, 08:13:22 pm »
Thanks for all the ideas! I'll give them all a try.


I've been also thinking about just scraping the indices from the PDFs, although there are probably internal methods out there that wouldn't be listed.

syntonica

  • Full Member
  • ***
  • Posts: 120
Re: Where's the Wallchart?
« Reply #6 on: December 11, 2019, 10:23:38 pm »
There is no such file, but there is a tool that can help you:

- open your project (in this case lhelp.lpi) in Lazarus
- go to View -> Code Browser
- change the combobox from "Lazarus IDE" to "Project" and enable the "With required packages" checkbox
- enter your procedure name in "Show identifier"
- the Code Browser will automatically search for the identifier; it might take a few moments, so be patient. :)
Let me preface this by saying that I'm using the 64-bit Cocoa version of Lazarus on Mojave. I'm avoiding the Carbon version since Carbon has been semi-broken since 10.9/10.10.  For testing and general coding, I'll be using Geany for now just because it gets all this extra stuff out of the way.  That's the one thing I do like about XCode--it strips away from view all the unnecessary junk. Except the code folding strip--that was very necessary, Apple!  >:(

I gave this a try. Aside from not being multi-threaded and blocking, it sort of worked. However, I was still not able to drill down to my target, in this case, starting from lhelp.lpr, Function BSearch(...) in htmldefs.pp.  Since BSearch is a local function, it doesn't show.

I also have found two more bugs:

1. In the Code Browser, the begins/contains buttons don't redraw themselves after coming out from behind another window. Sometimes. Like every bug, something seems to misbehave the first time I see it, but works thereafter when I try to reproduce it.
2. The tooltip that pops up on hover in the editor hides before I can click the link.  Fortunately, this did lead me to the discovery that I can use the Jump feature in the context menu to navigate to sources unexplored. I think this might work for me.

I'm probably sounding like I'm very fussy, but I prefer my tools to work the way I think rather than the other way around.


syntonica

  • Full Member
  • ***
  • Posts: 120
Re: Where's the Wallchart?
« Reply #7 on: December 11, 2019, 10:24:59 pm »
So, if I'm looking for a specific method, I can see which file it's in and where that file hangs out.
No wallchart. (That I know of)

But if you look at a specific method/property: TForm.Caption

You can use Code navigation:  https://wiki.lazarus.freepascal.org/Lazarus_IDE_Tools#Summary_Table_of_IDE_shortcuts
It will get you there.

However, with properties, you often end up in the base class, and it then takes you to the generic TWinControl.SetCaption.
And TForm may have its own SetCaption.

You can work your way up. Go to "TForm" and do ALt-Up and you get to the base class, and you can go from there to the next base and so on....
I just discovered this! Thanks!

PascalDragon

  • Hero Member
  • *****
  • Posts: 949
  • Compiler Developer
Re: Where's the Wallchart?
« Reply #8 on: December 12, 2019, 09:55:57 am »
I gave this a try. Aside from not being multi-threaded and blocking, it sort of worked. However, I was still not able to drill down to my target, in this case, starting from lhelp.lpr, Function BSearch(...) in htmldefs.pp.  Since BSearch is a local function, it doesn't show.
You might post a feature request to include local functions as well. After all there are already checkboxes for private and protected identifiers...

1. In the Code Browser, the begins/contains buttons don't redraw themselves after coming out from behind another window. Sometimes. Like every bug, something seems to misbehave the first time I see it, but works thereafter when I try to reproduce it.
2. The tooltip that pops up on hover in the editor hides before I can click the link.  Fortunately, this did lead me to the discovery that I can use the Jump feature in the context menu to navigate to sources unexplored. I think this might work for me.
If you manage to reproduce them you should report them. Especially the first one might be a bug in the LCL's Cocoa interface which is still heavily worked on.

syntonica

  • Full Member
  • ***
  • Posts: 120
Re: Where's the Wallchart?
« Reply #9 on: December 12, 2019, 10:15:59 am »
If you manage to reproduce them you should report them. Especially the first one might be a bug in the LCL's Cocoa interface which is still heavily worked on.
There's one I can report, that when using the mouse wheel to scroll a view, the event is not consumed, but passed to super, the container window, and causes the whole thing to bounce with easing like it's trying to scroll.  When I'm in the right headspace, I'll take a deeper look at the bug reporting system and see if it's not already reported.