line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
7546
|
use strict; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
62
|
|
2
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
133
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: Complete variable names in the REPL's lexical environment |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.003029'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use Devel::REPL::Plugin; |
8
|
2
|
|
|
2
|
|
11
|
use Devel::REPL::Plugin::Completion; # die early if cannot load |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
15
|
|
9
|
2
|
|
|
2
|
|
9068
|
use namespace::autoclean; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
44
|
|
10
|
2
|
|
|
2
|
|
9
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
18
|
|
11
|
|
|
|
|
|
|
my $self = shift; |
12
|
|
|
|
|
|
|
$self->load_plugin('Completion'); |
13
|
1
|
|
|
1
|
0
|
4
|
} |
14
|
1
|
|
|
|
|
8
|
|
15
|
|
|
|
|
|
|
around complete => sub { |
16
|
|
|
|
|
|
|
my $orig = shift; |
17
|
|
|
|
|
|
|
my ($self, $text, $document) = @_; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
my $last = $self->last_ppi_element($document); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
return $orig->(@_) |
22
|
|
|
|
|
|
|
unless $last->isa('PPI::Token::Symbol'); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
my ($sigil, $name) = split(//, $last, 2); |
25
|
|
|
|
|
|
|
my $re = qr/^\Q$name/; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
return $orig->(@_), |
28
|
|
|
|
|
|
|
# ReadLine is weirdly inconsistent |
29
|
|
|
|
|
|
|
map { $sigil eq '%' ? '%' . $_ : $_ } |
30
|
|
|
|
|
|
|
grep { /$re/ } |
31
|
|
|
|
|
|
|
map { substr($_, 1) } # drop lexical's sigil |
32
|
|
|
|
|
|
|
'$_REPL', keys %{$self->lexical_environment->get_context('_')}; |
33
|
|
|
|
|
|
|
}; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=pod |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=encoding UTF-8 |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 NAME |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Devel::REPL::Plugin::CompletionDriver::LexEnv - Complete variable names in the REPL's lexical environment |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 VERSION |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
version 1.003029 |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 SUPPORT |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Bugs may be submitted through L<the RT bug tracker|https://rt.cpan.org/Public/Dist/Display.html?Name=Devel-REPL> |
53
|
|
|
|
|
|
|
(or L<bug-Devel-REPL@rt.cpan.org|mailto:bug-Devel-REPL@rt.cpan.org>). |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
There is also an irc channel available for users of this distribution, at |
56
|
|
|
|
|
|
|
L<C<#devel> on C<irc.perl.org>|irc://irc.perl.org/#devel-repl>. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 AUTHOR |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Shawn M Moore, C<< <sartak at gmail dot com> >> |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENCE |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
This software is copyright (c) 2007 by Matt S Trout - mst (at) shadowcatsystems.co.uk (L<http://www.shadowcatsystems.co.uk/>). |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
67
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=cut |