diff options
Diffstat (limited to 'lib/Reply/Plugin/Autocomplete')
-rw-r--r-- | lib/Reply/Plugin/Autocomplete/Lexicals.pm | 18 | ||||
-rw-r--r-- | lib/Reply/Plugin/Autocomplete/Methods.pm | 10 |
2 files changed, 2 insertions, 26 deletions
diff --git a/lib/Reply/Plugin/Autocomplete/Lexicals.pm b/lib/Reply/Plugin/Autocomplete/Lexicals.pm index 204778a..c733fed 100644 --- a/lib/Reply/Plugin/Autocomplete/Lexicals.pm +++ b/lib/Reply/Plugin/Autocomplete/Lexicals.pm @@ -20,22 +20,6 @@ Perl code. =cut -sub new { - my $class = shift; - - my $self = $class->SUPER::new(@_); - $self->{env} = []; - - return $self; -} - -sub lexical_environment { - my $self = shift; - my ($env) = @_; - - push @{ $self->{env} }, $env; -} - sub tab_handler { my $self = shift; my ($line) = @_; @@ -48,7 +32,7 @@ sub tab_handler { # these can't be lexicals return if $sigil eq '&' || $sigil eq '*'; - my $env = { map { %$_ } @{ $self->{env} } }; + my $env = { map { %$_ } $self->publish('lexical_environment') }; my @env = keys %$env; my @results; diff --git a/lib/Reply/Plugin/Autocomplete/Methods.pm b/lib/Reply/Plugin/Autocomplete/Methods.pm index b643fb2..35de87e 100644 --- a/lib/Reply/Plugin/Autocomplete/Methods.pm +++ b/lib/Reply/Plugin/Autocomplete/Methods.pm @@ -26,19 +26,11 @@ sub new { my $class = shift; my $self = $class->SUPER::new(@_); - $self->{env} = []; $self->{package} = 'main'; return $self; } -sub lexical_environment { - my $self = shift; - my ($env) = @_; - - push @{ $self->{env} }, $env; -} - sub package { my $self = shift; my ($package) = @_; @@ -61,7 +53,7 @@ sub tab_handler { if ($invocant =~ /^\$/) { # XXX should support globals here my $env = { - map { %$_ } @{ $self->{env} }, + map { %$_ } $self->publish('lexical_environment'), }; my $var = $env->{$invocant}; return unless $var && ref($var) eq 'REF' && blessed($$var); |