PLS/Server/Response/DocumentSymbol.pm

filter: Statementstmt 61.2% 19 / 31 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 6 / 9 Podpod 0.0% 0 / 1 totaltotal 50.0% 25 / 50 CC 4 SCAR 20.1
CC
4
Cov
50%
__ANON__
20.0
new
2.0
__ANON__
2.0
CRAP 7.5
« PLS/Server/Method/ServerMethod.pm ↑ Summary PLS/Server/Response/Hover.pm »
1 package PLS::Server::Response::DocumentSymbol;
2  
3 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 9 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 9 ▶use parent 'PLS::Server::Response';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 9 ▶use IO::Async::Loop;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 9 ▶use PLS::Parser::Document;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 9 ▶use PLS::Parser::DocumentSymbols;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 =head1 NAME
14  
15 PLS::Server::Response::DocumentSymbol
16  
17 =head1 DESCRIPTION
18  
19 This is a message from the server to the client with a list
20 of symbols in the current document.
21  
22 =cut
23  
24 sub new
25 {
26 0 ▶ my ($class, $request) = @_;
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
27  
28 0 my $self = bless {id => $request->{id}, result => undef}, $class;
29  
30 0 my $uri = $request->{params}{textDocument}{uri};
31 0 my $version = PLS::Parser::Document::uri_version($uri);
32  
33 return PLS::Parser::DocumentSymbols->get_all_document_symbols_async($uri)->then(
34 sub {
35 0 ▶ my ($symbols) = @_;
Subroutine __ANON__: not called CC=4 SCAR=30.0
36  
37 0 my $current_version = PLS::Parser::Document::uri_version($uri);
38 0 ▶ return Future->done($self) unless (length $current_version);
Branch: 1 branch
BranchTrueFalseTotal
unless length $current_version 0 0 0
39 0 ▶ return Future->done($self) if (length $version and $current_version > $version);
Branch: 1 branch
BranchTrueFalseTotal
if length $version and $current_version > $version 0 0 0
Condition0%0/3
length $version and $current_version > $version
!ll&&!rl&&r
000
MC/DC0%0/2
length $version and $current_version > $version
length $version $current_version > $version
Truth table0%0/3
A and B
A= length $versionB= $current_version > $version
ABresult
0X0
100
111
40  
41 0 $self->{result} = $symbols;
42 0 return Future->done($self);
43 },
44 sub {
45 0 ▶ return Future->done($self);
Subroutine __ANON__: not called CC=1 SCAR=6.9
46 }
47 0 );
48 } ## end sub new
49  
50 9 1;
« PLS/Server/Method/ServerMethod.pm ↑ Summary PLS/Server/Response/Hover.pm »