Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

which-function-mode? pretty please? #9

Open
chipdude opened this Issue · 4 comments

2 participants

@chipdude

No description provided.

@jrockway
Owner

Sure. Do you have any suggestions for an algorithm to use? It would be nice to detect package boundaries, not be fooled by code like sub foo { sub { ... } }, and optionally support other "sub defining keywords", like "method".

(Note that unlike most static analysis packages, we have to be able to get the right answer even when the code is sligthly malformed, like as it's being typed in.)

Anyway, I played with something similar to this in Pure Perl a while ago, see http://cpansearch.perl.org/src/JROCKWAY/Devel-InPackage-0.01/lib/Devel/InPackage.pm. Your thoughts would be appreciated.

@chipdude

The idea is to help with gross navigation, so I personally would be content with support for

m{ ^ \s* package \s+ (\w[:\w]) }xm
m{ ^ \s
$sub_keyword \s+ (\w[:\w]*) }xm

where default $sub_keyword is 'sub', 'method', 'before', 'after', 'around', and now 'func' (see Method::Signatures::Simple)

@jrockway
Owner
@chipdude
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.