X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-REPL.git;a=blobdiff_plain;f=lib%2FDevel%2FREPL%2FPlugin%2FCompletionDriver%2FMethods.pm;h=3f7d2d622c3a60129057427167badde816c199f8;hp=aa09f0e9083e043f435696bdcdca744465ffcb55;hb=b1c838027a427ea0e16bdf60024826b3ed1574f8;hpb=cfd1094b45c394258ccda08216f1435bf40e1d50 diff --git a/lib/Devel/REPL/Plugin/CompletionDriver/Methods.pm b/lib/Devel/REPL/Plugin/CompletionDriver/Methods.pm index aa09f0e..3f7d2d6 100644 --- a/lib/Devel/REPL/Plugin/CompletionDriver/Methods.pm +++ b/lib/Devel/REPL/Plugin/CompletionDriver/Methods.pm @@ -1,8 +1,16 @@ +use strict; +use warnings; package Devel::REPL::Plugin::CompletionDriver::Methods; use Devel::REPL::Plugin; -use namespace::clean -except => [ 'meta' ]; +use Devel::REPL::Plugin::Completion; # die early if cannot load +use namespace::autoclean; -with 'Devel::REPL::Plugin::FindVariable'; +sub BEFORE_PLUGIN { + my $self = shift; + for (qw/Completion FindVariable/) { + $self->load_plugin($_); + } +} around complete => sub { my $orig = shift; @@ -52,8 +60,8 @@ around complete => sub { return $orig->(@_), grep { $_ =~ $re } - map { $_->{name} } - $metaclass->compute_all_applicable_methods; + map { $_->name } + $metaclass->get_all_methods; }; 1; @@ -64,5 +72,9 @@ __END__ Devel::REPL::Plugin::CompletionDriver::Methods - Complete class or object method names +=head1 AUTHOR + +Shawn M Moore, C<< >> + =cut