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