Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

mr_bean (3802)

mr_bean
  (email not shown publicly)

Journal of mr_bean (3802)

Tuesday July 04, 2006
09:24 PM

editor tags

[ #30174 ]

I'm really excited by osfameron's Perl::Tags with vim, because it creates tags as you go. Tags are great for clicking your way round your code. However vim's tags are created statically.

Perl::Tags creates them dynamically as you jump from one module to another. The problem before it was, You never knew where you were going to go, and it was impossible to create tags for all the things you might be interested in beforehand. So you ended up never using tags outside your own code.

But with Perl::Tags, you don't have this restriction. It helps me moving back and forth between my garden of relatively well-understood code and the jungle of code outside my garden which I need to subdue.

You can also write regex to create tags not just for subs, vars and packages, but for anything you can parse. ctags could do this, eg tagging Spiffy fields

ctags "--regex-perl=/^\s*field '?(\w+)(';| => .*;)$/\1/f,field,class attribute accessor methods/" -R

But it's nicer to be able to do it as part of a perl module.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Thanks for the feedback: I'm interested that you're thinking about extending it to tag other things - how are you tackling this? Subclassing Perl::Tags::Naive and replacing get_parsers and adding new parsers there? (I can change get_parsers to use $self->can('package_line') instead of \&package_line to make it easier to subclass).

    Or if you have a better approach to extending, let me know!

    --

    osfameron

    • I don't know what the best way to do it is. The easiest way was just to cut and paste into Tags.pm, but when I lost my changes installing 0.21, I decided I had to subclass.

      I expected I would only have to add the new parser into my subclass, but I also had to have the old parsers there too, which was a little surprising.

      The parsers are subroutines, rather than methods?