blib/lib/PLS/Server/Response/Hover.pm

filter: Statementstmt 59.0% 13 / 22 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 1 totaltotal 53.1% 17 / 32 CC 3 SCAR 17.4
CC
3
Cov
50%
new
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 5.7
« blib/lib/PLS/Server/Response/DocumentSymbol.pm ↑ Summary blib/lib/PLS/Server/Request/Factory.pm »
1 package PLS::Server::Response::Hover;
2  
3 13 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 13 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 13 ▶use parent q(PLS::Server::Response);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 13 ▶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 0 ▶{
Subroutine new: not called CC=3 SCAR=24.8
Pod undocumented
23 0 my ($class, $request) = @_;
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}, line => $request->{params}{position}{line});
31 0 ▶ return $self if (ref $document ne 'PLS::Parser::Document');
Branch: 1 branch
BranchTrueFalseTotal
if ref $document ne "PLS::Parser::Document" 0 0 0
32 0 my ($ok, $pod) = $document->find_pod($request->{params}{textDocument}{uri}, 1, $request->{params}{position}{character});
33 0 ▶ return $self unless $ok;
Branch: 1 branch
BranchTrueFalseTotal
unless $ok 0 0 0
34  
35 $self->{result} = {
36 0 contents => {kind => 'markdown', value => ${$pod->{markdown}}},
37 range => $pod->{element}->range()
38 0 };
39  
40 0 return $self;
41 } ## end sub new
42  
43 13 1;
« blib/lib/PLS/Server/Response/DocumentSymbol.pm ↑ Summary blib/lib/PLS/Server/Request/Factory.pm »