line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PLS::Server::Response::Resolve; |
2
|
|
|
|
|
|
|
|
3
|
9
|
|
|
9
|
|
54
|
use strict; |
|
9
|
|
|
|
|
10
|
|
|
9
|
|
|
|
|
216
|
|
4
|
9
|
|
|
9
|
|
36
|
use warnings; |
|
9
|
|
|
|
|
9
|
|
|
9
|
|
|
|
|
181
|
|
5
|
|
|
|
|
|
|
|
6
|
9
|
|
|
9
|
|
36
|
use parent 'PLS::Server::Response'; |
|
9
|
|
|
|
|
10
|
|
|
9
|
|
|
|
|
36
|
|
7
|
|
|
|
|
|
|
|
8
|
9
|
|
|
9
|
|
3748
|
use PLS::Parser::Index; |
|
9
|
|
|
|
|
27
|
|
|
9
|
|
|
|
|
313
|
|
9
|
9
|
|
|
9
|
|
3849
|
use PLS::Parser::Pod::Package; |
|
9
|
|
|
|
|
36
|
|
|
9
|
|
|
|
|
288
|
|
10
|
9
|
|
|
9
|
|
3256
|
use PLS::Parser::Pod::Subroutine; |
|
9
|
|
|
|
|
27
|
|
|
9
|
|
|
|
|
269
|
|
11
|
9
|
|
|
9
|
|
45
|
use PLS::Parser::Pod::Builtin; |
|
9
|
|
|
|
|
30
|
|
|
9
|
|
|
|
|
4614
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 NAME |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
PLS::Server::Response::Resolve |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 DESCRIPTION |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
This is a message from the server to the client with documentation |
20
|
|
|
|
|
|
|
about the currently selected completion item. |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=cut |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub new |
25
|
|
|
|
|
|
|
{ |
26
|
0
|
|
|
0
|
0
|
|
my ($class, $request) = @_; |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
my $self = {id => $request->{id}, result => undef}; |
29
|
0
|
|
|
|
|
|
bless $self, $class; |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
my $index = PLS::Parser::Index->new(); |
32
|
0
|
|
|
|
|
|
my $kind = $request->{params}{kind}; |
33
|
|
|
|
|
|
|
|
34
|
0
|
0
|
0
|
|
|
|
if ($kind == 6) |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
35
|
|
|
|
|
|
|
{ |
36
|
0
|
|
|
|
|
|
my $pod = PLS::Parser::Pod::Variable->new(variable => $request->{params}{label}); |
37
|
0
|
|
|
|
|
|
my $ok = $pod->find(); |
38
|
|
|
|
|
|
|
|
39
|
0
|
0
|
|
|
|
|
if ($ok) |
40
|
|
|
|
|
|
|
{ |
41
|
0
|
|
|
|
|
|
$self->{result} = $request->{params}; |
42
|
0
|
|
|
|
|
|
$self->{result}{documentation} = {kind => 'markdown', value => ${$pod->{markdown}}}; |
|
0
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
} ## end if ($kind == 6) |
45
|
|
|
|
|
|
|
elsif ($kind == 7) |
46
|
|
|
|
|
|
|
{ |
47
|
0
|
|
|
|
|
|
my $pod = PLS::Parser::Pod::Package->new(index => $index, package => $request->{params}{label}); |
48
|
0
|
|
|
|
|
|
my $ok = $pod->find(); |
49
|
|
|
|
|
|
|
|
50
|
0
|
0
|
|
|
|
|
if ($ok) |
51
|
|
|
|
|
|
|
{ |
52
|
0
|
|
|
|
|
|
$self->{result} = $request->{params}; |
53
|
0
|
|
|
|
|
|
$self->{result}{documentation} = {kind => 'markdown', value => ${$pod->{markdown}}}; |
|
0
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
} ## end elsif ($kind == 7) |
56
|
|
|
|
|
|
|
elsif ($kind == 3 or $kind == 21) |
57
|
|
|
|
|
|
|
{ |
58
|
0
|
|
|
|
|
|
my ($package, $subroutine); |
59
|
|
|
|
|
|
|
|
60
|
0
|
0
|
0
|
|
|
|
if ($request->{params}{label} =~ /->/ or ($request->{params}{sortText} // '') =~ /->/) |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
61
|
|
|
|
|
|
|
{ |
62
|
0
|
0
|
|
|
|
|
my $label = $request->{params}{label} =~ /->/ ? $request->{params}{label} : $request->{params}{sortText}; |
63
|
0
|
|
|
|
|
|
($package, $subroutine) = split /->/, $label; |
64
|
0
|
|
|
|
|
|
$package = [$package]; |
65
|
|
|
|
|
|
|
} ## end if ($request->{params}...) |
66
|
|
|
|
|
|
|
elsif ($request->{params}{label} =~ /::/ or ($request->{params}{filterText} // '') =~ /::/) |
67
|
|
|
|
|
|
|
{ |
68
|
0
|
0
|
|
|
|
|
my $label = $request->{params}{label} =~ /::/ ? $request->{params}{label} : $request->{params}{filterText}; |
69
|
0
|
|
|
|
|
|
my @parts = split /::/, $label; |
70
|
0
|
|
|
|
|
|
$subroutine = pop @parts; |
71
|
0
|
|
|
|
|
|
$package = [join '::', @parts]; |
72
|
|
|
|
|
|
|
} ## end elsif ($request->{params}...) |
73
|
|
|
|
|
|
|
else |
74
|
|
|
|
|
|
|
{ |
75
|
0
|
|
|
|
|
|
$subroutine = $request->{params}{label}; |
76
|
0
|
0
|
|
|
|
|
$package = $request->{params}{data} if (ref $request->{params}{data} eq 'ARRAY'); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
0
|
|
|
|
|
|
my $pod = PLS::Parser::Pod::Subroutine->new(index => $index, packages => $package, subroutine => $subroutine); |
80
|
0
|
|
|
|
|
|
my $ok = $pod->find(); |
81
|
|
|
|
|
|
|
|
82
|
0
|
0
|
|
|
|
|
if ($ok) |
83
|
|
|
|
|
|
|
{ |
84
|
0
|
|
|
|
|
|
$self->{result} = $request->{params}; |
85
|
0
|
|
|
|
|
|
$self->{result}{documentation} = {kind => 'markdown', value => ${$pod->{markdown}}}; |
|
0
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
} ## end elsif ($kind == 3 or $kind...) |
88
|
|
|
|
|
|
|
elsif ($kind == 14) |
89
|
|
|
|
|
|
|
{ |
90
|
0
|
|
|
|
|
|
my $pod = PLS::Parser::Pod::Builtin->new(function => $request->{params}{label}); |
91
|
0
|
|
|
|
|
|
my $ok = $pod->find(); |
92
|
|
|
|
|
|
|
|
93
|
0
|
0
|
|
|
|
|
if ($ok) |
94
|
|
|
|
|
|
|
{ |
95
|
0
|
|
|
|
|
|
$self->{result} = $request->{params}; |
96
|
0
|
|
|
|
|
|
$self->{result}{documentation} = {kind => 'markdown', value => ${$pod->{markdown}}}; |
|
0
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
} ## end elsif ($kind == 14) |
99
|
|
|
|
|
|
|
|
100
|
0
|
|
|
|
|
|
return $self; |
101
|
|
|
|
|
|
|
} ## end sub new |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
1; |