PLS/Server/Response/Hover.pm

filter: Statementstmt 59.0% 13 / 22 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 1 totaltotal 56.6% 17 / 30 CC 2 SCAR 9.8
CC
2
Cov
54%
new
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
« PLS/Server/Response/SignatureHelp.pm ↑ Summary PLS/Server/Response/Formatting.pm »
1 package PLS::Server::Response::Hover;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use parent q(PLS::Server::Response);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use PLS::Parser::Document;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 =head1 NAME
11  
12 PLS::Server::Response::Hover
13  
14 =head1 DESCRIPTION
15  
16 This is a message from the server to the client with
17 documentation for the location the mouse is currently hovering.
18  
19 =cut
20  
21 sub new
22 {
23 0 ▶ my ($class, $request) = @_;
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
24  
25 my $self = bless {
26 id => $request->{id},
27 0 result => undef
28 }, $class;
29  
30 0 my $document = PLS::Parser::Document->new(uri => $request->{params}{textDocument}{uri});
31 0 my ($ok, $pod) = $document->find_pod(@{$request->{params}{position}}{qw(line character)});
32 0 ▶ return $self unless $ok;
Branch: 1 branch
BranchTrueFalseTotal
unless $ok 0 0 0
33  
34 $self->{result} = {
35 0 contents => {kind => 'markdown', value => ${$pod->{markdown}}},
36 range => {
37 start => {
38 line => $pod->line_number,
39 character => $pod->column_number,
40 },
41 end => {
42 line => $pod->line_number,
43 character => $pod->column_number + length $pod->{element}->content,
44 }
45 }
46 0 };
47  
48 0 return $self;
49 } ## end sub new
50  
51 1 1;
« PLS/Server/Response/SignatureHelp.pm ↑ Summary PLS/Server/Response/Formatting.pm »