I had 12 hours of desk time the other night, so I tarted fooling around with my idea for a Perl class browser. As I was looking through the Tk stuff, I found Tk::Browser, which looks like a class browser that didn't get off of the ground.
It really sucks that I cannot upload anything, so you have to satisify yourself with mere commentary.
I started fooling around with Tk::HList which displays a tree structure file-manager type view. With a little programming, I got the tree to show and hide various parts of itself. I will turn that into a subclass of Tk::HList since I think that that behaviour is probably what most people want with the widget.
After I can show the various modules in the widget, I can select them and have their POD and other info show up in other widgets. I display the version number, and want to work on fetching the most recent version from CPAN too (remember, I have CPAN on my laptop).
I'm dubious about other features, like showing variables and whatnot. Other languages make this easily because most things are known, but with Perl features like AUTOLOAD, code analysis is not better than documentation necessarily.
My thoughts also bring me back to a side effect of AutoSplit. The documentation for a routine does not stay with the routine. It is no big deal because we're not supposed to be mucking around in the auto directories anyway. However, I really like the method browser in Squeak (Smalltalk) and how the documentation is part of the method. We could do this in Perl:
sub foo { =item foo
Docs go here, inside the sub
=cut
}
-sam
Re:A couple ideas
brian_d_foy on 2003-11-11T20:02:36
Ooooh, inheritance trees. That could be fun to play with.
Some sort of happy face icon for strict and whatnot, perhaps?
Module use,hmmm, maybe. I have it set up so that the browser only looks in the currently installed modules, so any module it needs should already be there. It should be easy to add though.
I think for a lot of this stuff I am going to have to write a program to walk the module directories and create data files. If I do too many things, the time to select a module and then see its contents will be too painful. Hmmm, that also means an update sort of feature.
Too bad I'm back on the road in a couple of days.Re:A couple ideas
domm on 2003-11-11T20:15:21
You might want to check out CPANXR and/or Module::CPANTS, both heavily under development (well CPANTS not so mucht right now, but I'll have some time soon!)
I don't think its entirely finished but it may save you a bit of work if you decide to do a method browser.
Also it handles AUTOLOAD just by letting you know that its being used by the object and from which package it came from.