line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use strict; |
3
|
9
|
|
|
9
|
|
46
|
use warnings; |
|
9
|
|
|
|
|
26
|
|
|
9
|
|
|
|
|
205
|
|
4
|
9
|
|
|
9
|
|
37
|
|
|
9
|
|
|
|
|
66
|
|
|
9
|
|
|
|
|
228
|
|
5
|
|
|
|
|
|
|
use parent q(PLS::Server::Response); |
6
|
9
|
|
|
9
|
|
60
|
|
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
44
|
|
7
|
|
|
|
|
|
|
use PLS::Parser::Document; |
8
|
9
|
|
|
9
|
|
486
|
|
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
1637
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
PLS::Server::Response::Location |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 DESCRIPTION |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
This is a message from the server to the client providing a location. |
16
|
|
|
|
|
|
|
This is typically used to provide the location of the definition of a symbol. |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=cut |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
{ |
21
|
|
|
|
|
|
|
my ($class, $request) = @_; |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
0
|
0
|
|
my $self = { |
24
|
|
|
|
|
|
|
id => $request->{id}, |
25
|
|
|
|
|
|
|
result => undef |
26
|
|
|
|
|
|
|
}; |
27
|
0
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
bless $self, $class; |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
my $document = PLS::Parser::Document->new(uri => $request->{params}{textDocument}{uri}); |
31
|
|
|
|
|
|
|
return $self if (ref $document ne 'PLS::Parser::Document'); |
32
|
0
|
|
|
|
|
|
|
33
|
0
|
0
|
|
|
|
|
my $results = $document->go_to_definition(@{$request->{params}{position}}{qw(line character)}); |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
if (ref $results eq 'ARRAY') |
|
0
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
{ |
37
|
0
|
0
|
|
|
|
|
foreach my $result (@$results) |
38
|
|
|
|
|
|
|
{ |
39
|
0
|
|
|
|
|
|
delete @{$result}{qw(package signature kind)}; |
40
|
|
|
|
|
|
|
} |
41
|
0
|
|
|
|
|
|
} ## end if (ref $results eq 'ARRAY'...) |
|
0
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
$self->{result} = $results; |
44
|
|
|
|
|
|
|
return $self; |
45
|
0
|
|
|
|
|
|
} ## end sub new |
46
|
0
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |