r61091@onn: sartak | 2008-05-26 21:32:50 -0400
[p5sagit/Devel-REPL.git] / lib / Devel / REPL / Plugin / CompletionDriver / LexEnv.pm
index 2011896..8fb5d0f 100644 (file)
@@ -14,11 +14,7 @@ around complete => sub {
   my $orig = shift;
   my ($self, $text, $document) = @_;
 
-  # recursively find the last element
-  my $last = $document;
-  while ($last->can('last_element') && defined($last->last_element)) {
-      $last = $last->last_element;
-  }
+  my $last = $self->last_ppi_element($document);
 
   return $orig->(@_)
     unless $last->isa('PPI::Token::Symbol');
@@ -36,3 +32,11 @@ around complete => sub {
 
 1;
 
+__END__
+
+=head1 NAME
+
+Devel::REPL::Plugin::CompletionDriver::LexEnv - Complete variable names in the REPL's lexical environment
+
+=cut
+