Sign in Join

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

Mailing lists / lazarus / 2016-07

Procedure List + CodeTools not showing nested procedures

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Graeme Geldenhuys

Hi,

See the attached screenshots showing a comparative Procedure List result for the same unit with the same search term. The one screenshot is of Maximus IDE, and the other is from Lazarus IDE.

Lazarus IDE’s Procedure List uses CodeTools to find and populate the ListView, but it doesn’t find any nested procedures or functions.

eg:

  TMainForm.SomeMethod;
  var
    x,y: integer;
    procedure LocalProc;
    begin
      // some code here
    end;
  begin
    // some code here.
  end;

Lazarus’s Procedure List will not find the LocalProc procedure. The code to populate the ListView is here…

  procedure TProcedureListForm.PopulateListview;

in the <laz>/ide/procedurelist.pas unit.

Anybody with more CodeTools knowledge than I know what should be changed to find such nested procedures or functions?

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 -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot_lazarus.png Type: image/png Size: 9865 bytes Desc: not available URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160713/cd5e7d00/attachment-0002.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot_maximus.png Type: image/png Size: 10901 bytes Desc: not available URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160713/cd5e7d00/attachment-0003.png>

Reply by email

Mattias Gaertner
to Graeme Geldenhuys
Show quoted text 33 lines
Hi, See the attached screenshots showing a comparative Procedure List result for the same unit with the same search term. The one screenshot is of Maximus IDE, and the other is from Lazarus IDE. Lazarus IDE’s Procedure List uses CodeTools to find and populate the ListView, but it doesn’t find any nested procedures or functions. eg: TMainForm.SomeMethod; var x,y: integer; procedure LocalProc; begin // some code here end; begin // some code here. end; Lazarus’s Procedure List will not find the LocalProc procedure. The code to populate the ListView is here… procedure TProcedureListForm.PopulateListview; in the <laz>/ide/procedurelist.pas unit. Anybody with more CodeTools knowledge than I know what should be changed to find such nested procedures or functions?

It iterated with 'NextBrother'. I changed it to 'Next'.

I also changed it to prepend the parent proc names. For example instead of 'LocalProc' it shows 'TMainForm.SomeMethod.LocalProc'. If you don't like that feel free to change it.

Mattias

Reply by email

Graeme Geldenhuys
to Mattias Gaertner
Mattias Gaertner wrote
of 'LocalProc' it shows 'TMainForm.SomeMethod.LocalProc'. If you don't like that feel free to change it.

Thank you Mattias for taking a look and making the changes. I'll give it a try as soon as I can compile Lazarus trunk.

Regards,
Graeme

Reply by email